1
0
mirror of https://github.com/golang/go synced 2024-11-08 08:56:16 -07:00
go/src/cmd/trace
Daniel Martí 64a832debe cmd/trace: fix a few bugs found by staticcheck
First, the regions sort was buggy, as its last comparison was
ineffective.

Second, the insyscall and insyscallRuntime fields were unsigned, so the
check for them being negative was pointless. Make them signed instead,
to also prevent the possibility of underflows when decreasing numbers
that might realistically be 0.

Third, the color constants were all untyped strings except the first
one. Be consistent with their typing.

Change-Id: I4eb8d08028ed92589493c2a4b9cc5a88d83f769b
Reviewed-on: https://go-review.googlesource.com/113895
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-05-21 16:18:29 +00:00
..
annotations_test.go runtime/trace: rename "Span" with "Region" 2018-04-24 16:33:15 +00:00
annotations.go cmd/trace: fix a few bugs found by staticcheck 2018-05-21 16:18:29 +00:00
doc.go
goroutines.go cmd/trace: beautify goroutine page 2018-03-26 15:36:56 +00:00
main.go runtime/trace: rename "Span" with "Region" 2018-04-24 16:33:15 +00:00
pprof.go runtime/trace: rename "Span" with "Region" 2018-04-24 16:33:15 +00:00
trace_test.go cmd/trace: distinguish task endTimestamp and lastTimestamp 2018-04-24 21:49:40 +00:00
trace_unix_test.go cmd/trace: skip GoroutineInSyscall in case time order err 2018-04-10 17:09:30 +00:00
trace.go cmd/trace: fix a few bugs found by staticcheck 2018-05-21 16:18:29 +00:00