aboutsummaryrefslogtreecommitdiff
path: root/src/internal/trace/parser.go
diff options
context:
space:
mode:
authorDaniel Martí <mvdan@mvdan.cc>2018-03-24 15:49:43 +0000
committerDaniel Martí <mvdan@mvdan.cc>2018-03-24 19:44:47 +0000
commit8da180f6cac51f6cb8a316b962f797dbaf7ee96f (patch)
tree0dc75b1158d5c984d8c70e42228297fc75e97be6 /src/internal/trace/parser.go
parentb1892d740eaeddc46a0c735b472718149c438844 (diff)
downloadgo-8da180f6cac51f6cb8a316b962f797dbaf7ee96f.tar.xz
all: remove some unused return parameters
As found by unparam. Picked the low-hanging fruit, consisting only of errors that were always nil and results that were never used. Left out those that were useful for consistency with other func signatures. Change-Id: I06b52bbd3541f8a5d66659c909bd93cb3e172018 Reviewed-on: https://go-review.googlesource.com/102418 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/internal/trace/parser.go')
-rw-r--r--src/internal/trace/parser.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/internal/trace/parser.go b/src/internal/trace/parser.go
index 29ba73c761..6d142a593f 100644
--- a/src/internal/trace/parser.go
+++ b/src/internal/trace/parser.go
@@ -108,10 +108,7 @@ func parse(r io.Reader, bin string) (int, ParseResult, error) {
if err != nil {
return 0, ParseResult{}, err
}
- events, err = removeFutile(events)
- if err != nil {
- return 0, ParseResult{}, err
- }
+ events = removeFutile(events)
err = postProcessTrace(ver, events)
if err != nil {
return 0, ParseResult{}, err
@@ -505,7 +502,7 @@ func parseEvents(ver int, rawEvents []rawEvent, strings map[uint64]string) (even
// ahead and acquired the mutex before the first goroutine is scheduled,
// so the first goroutine has to block again. Such wakeups happen on buffered
// channels and sync.Mutex, but are generally not interesting for end user.
-func removeFutile(events []*Event) ([]*Event, error) {
+func removeFutile(events []*Event) []*Event {
// Two non-trivial aspects:
// 1. A goroutine can be preempted during a futile wakeup and migrate to another P.
// We want to remove all of that.
@@ -552,7 +549,7 @@ func removeFutile(events []*Event) ([]*Event, error) {
newEvents = append(newEvents, ev)
}
}
- return newEvents, nil
+ return newEvents
}
// ErrTimeOrder is returned by Parse when the trace contains