fork of https://github.com/sourcegraph/zoekt
0

Configure Feed

Select the types of activity you want to include in your feed.

cmd/zoekt: trim '\n' from match (#867)

Before, we'd typically have two newlines, one coming from the corpus,
and one terminating the fmt.Printf call.

+3 -1
+3 -1
cmd/zoekt/main.go
··· 15 15 package main 16 16 17 17 import ( 18 + "bytes" 18 19 "context" 19 20 "flag" 20 21 "fmt" ··· 44 45 } 45 46 46 47 for _, m := range f.LineMatches { 47 - fmt.Printf("%s%s:%d:%s%s\n", r, f.FileName, m.LineNumber, m.Line, addTabIfNonEmpty(f.Debug)) 48 + l := bytes.TrimSuffix(m.Line, []byte{'\n'}) 49 + fmt.Printf("%s%s:%d:%s%s\n", r, f.FileName, m.LineNumber, l, addTabIfNonEmpty(f.Debug)) 48 50 } 49 51 } 50 52 }