pkg/compose: go fix

Signed-off-by: Sebastiaan van Stijn <[email protected]>
This commit is contained in:
Sebastiaan van Stijn
2026-05-11 13:40:24 +02:00
committed by Nicolas De loof
parent 2bbb88acf9
commit 88545507e8
+2 -2
View File
@@ -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
}