MCPcopy Create free account
hub / github.com/imroc/req / fileLine

Method fileLine

internal/bisect/bisect.go:386–396  ·  view source on GitHub ↗

fileLine does the real work for FileLine. This lets FileLine's body handle m == nil and potentially be inlined.

(w Writer, file string, line int)

Source from the content-addressed store, hash-verified

384// fileLine does the real work for FileLine.
385// This lets FileLine's body handle m == nil and potentially be inlined.
386func (m *Matcher) fileLine(w Writer, file string, line int) bool {
387 h := Hash(file, line)
388 if m.ShouldPrint(h) {
389 if m.MarkerOnly() {
390 PrintMarker(w, h)
391 } else {
392 printFileLine(w, h, file, line)
393 }
394 }
395 return m.ShouldEnable(h)
396}
397
398// printFileLine prints a non-marker-only report for file:line to w.
399func printFileLine(w Writer, h uint64, file string, line int) error {

Callers 1

FileLineMethod · 0.95

Calls 6

ShouldPrintMethod · 0.95
MarkerOnlyMethod · 0.95
ShouldEnableMethod · 0.95
HashFunction · 0.85
PrintMarkerFunction · 0.85
printFileLineFunction · 0.85

Tested by

no test coverage detected