aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/report/linux.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-03-08 18:48:26 +0100
committerDmitry Vyukov <dvyukov@google.com>2018-03-08 18:48:26 +0100
commit36d1c4540af3ef058d68092e41af05aa4a8c5eca (patch)
tree3657a5920e4b100749ccb9d2d555652e7b7e28e9 /pkg/report/linux.go
parent63ef857906766b3cafe4aebc43bc38edf42096c3 (diff)
all: fix gometalinter warnings
Fix typos, non-canonical code, remove dead code, etc.
Diffstat (limited to 'pkg/report/linux.go')
-rw-r--r--pkg/report/linux.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/pkg/report/linux.go b/pkg/report/linux.go
index 4fbf5ddc3..703b41fb4 100644
--- a/pkg/report/linux.go
+++ b/pkg/report/linux.go
@@ -159,7 +159,7 @@ func (ctx *linux) Parse(output []byte) *Report {
}
}
if ctx.consoleOutputRe.Match(line) &&
- (!ctx.questionableRe.Match(line) || bytes.Index(line, ctx.eoi) != -1) {
+ (!ctx.questionableRe.Match(line) || bytes.Contains(line, ctx.eoi)) {
lineStart := bytes.Index(line, []byte("] ")) + pos + 2
lineEnd := next
if lineEnd != 0 && output[lineEnd-1] == '\r' {
@@ -352,12 +352,8 @@ func symbolizeLine(symbFunc func(bin string, pc uint64) ([]symbolizer.Frame, err
var symbolized []byte
for _, frame := range frames {
file := frame.File
- if strings.HasPrefix(file, strip) {
- file = file[len(strip):]
- }
- if strings.HasPrefix(file, "./") {
- file = file[2:]
- }
+ file = strings.TrimPrefix(file, strip)
+ file = strings.TrimPrefix(file, "./")
info := fmt.Sprintf(" %v:%v", file, frame.Line)
modified := append([]byte{}, line...)
modified = replace(modified, match[7], match[7], []byte(info))