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

Function isHeaderLine

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

Source from the content-addressed store, hash-verified

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

Callers 1

colorDiffLinesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected