MCPcopy Create free account
hub / github.com/cli/cli / isHeaderLine

Function isHeaderLine

pkg/cmd/pr/diff/diff.go:301–309  ·  view source on GitHub ↗
(l []byte)

Source from the content-addressed store, hash-verified

299var diffHeaderPrefixes = []string{"+++", "---", "diff", "index"}
300
301func isHeaderLine(l []byte) bool {
302 dl := string(l)
303 for _, p := range diffHeaderPrefixes {
304 if strings.HasPrefix(dl, p) {
305 return true
306 }
307 }
308 return false
309}
310
311func isAdditionLine(l []byte) bool {
312 return len(l) > 0 && l[0] == '+'

Callers 1

colorDiffLinesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected