mirror of
https://github.com/docker/compose.git
synced 2026-10-12 02:13:08 +00:00
pkg/compose: go fix
Signed-off-by: Sebastiaan van Stijn <[email protected]>
This commit is contained in:
committed by
Nicolas De loof
parent
2bbb88acf9
commit
88545507e8
@@ -285,8 +285,8 @@ func (c CommandMetadata) CheckRequiredParameters(provider types.ServiceProviderC
|
||||
// firstLine returns the first line of s, stripping any trailing newlines.
|
||||
func firstLine(s string) string {
|
||||
s = strings.TrimRight(s, "\n")
|
||||
if i := strings.IndexByte(s, '\n'); i >= 0 {
|
||||
return s[:i]
|
||||
if before, _, ok := strings.Cut(s, "\n"); ok {
|
||||
return before
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user