MCPcopy
hub / github.com/docker/compose / firstLine

Function firstLine

pkg/compose/plugins.go:325–331  ·  view source on GitHub ↗

firstLine returns the first line of s, stripping any trailing newlines.

(s string)

Source from the content-addressed store, hash-verified

323
324// firstLine returns the first line of s, stripping any trailing newlines.
325func firstLine(s string) string {
326 s = strings.TrimRight(s, "\n")
327 if before, _, ok := strings.Cut(s, "\n"); ok {
328 return before
329 }
330 return s
331}

Callers 1

executePluginMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected