diff --git a/pkg/compose/plugins.go b/pkg/compose/plugins.go index a0eee8a37..90dfd202a 100644 --- a/pkg/compose/plugins.go +++ b/pkg/compose/plugins.go @@ -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 }