Files
mesh-catalog/modules/ssh-client/cmd/ssh-client-tools/firstline.go
T

14 lines
239 B
Go

package main
import "strings"
// firstLine is the first non-empty line of s, trimmed.
func firstLine(s string) string {
for _, l := range strings.Split(s, "\n") {
if l = strings.TrimSpace(l); l != "" {
return l
}
}
return ""
}