MCPcopy Index your code
hub / github.com/cli/cli / sortLines

Function sortLines

pkg/cmd/codespace/delete_test.go:339–348  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

337}
338
339func sortLines(s string) string {
340 trailing := ""
341 if strings.HasSuffix(s, "\n") {
342 s = strings.TrimSuffix(s, "\n")
343 trailing = "\n"
344 }
345 lines := strings.Split(s, "\n")
346 sort.Strings(lines)
347 return strings.Join(lines, "\n") + trailing
348}

Callers 2

TestDeleteFunction · 0.85
TestApp_SelectFunction · 0.85

Calls 1

JoinMethod · 0.80

Tested by

no test coverage detected