pkg/compose: go fix
Some checks are pending
ci / validate (lint) (push) Waiting to run
ci / validate (validate-docs) (push) Waiting to run
ci / validate (validate-go-mod) (push) Waiting to run
ci / validate (validate-headers) (push) Waiting to run
ci / binary (push) Waiting to run
ci / binary-finalize (push) Blocked by required conditions
ci / bin-image-test (push) Waiting to run
ci / test (push) Waiting to run
ci / e2e (plugin, oldstable) (push) Waiting to run
ci / e2e (standalone, oldstable) (push) Waiting to run
ci / e2e (plugin, stable) (push) Waiting to run
ci / e2e (standalone, stable) (push) Waiting to run
ci / coverage (push) Blocked by required conditions
ci / release (push) Blocked by required conditions
merge / bin-image-prepare (push) Waiting to run
merge / bin-image (push) Blocked by required conditions
merge / module-image (push) Waiting to run
merge / desktop-edge-test (push) Blocked by required conditions
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2026-05-08 00:32:29 +02:00 committed by Nicolas De loof
parent 2bbb88acf9
commit 88545507e8

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
}