all: use bytes.Equal, bytes.Contains and strings.Contains

Change-Id: Iba82a5bd3846f7ab038cc10ec72ff6bcd2c0b484
Reviewed-on: https://go-review.googlesource.com/21377
Run-TryBot: Dave Cheney <dave@cheney.net>
Reviewed-by: Dave Cheney <dave@cheney.net>
This commit is contained in:
Dominik Honnef 2016-04-01 03:49:43 +02:00 committed by Dave Cheney
parent 42d6294694
commit 1cb3044c9f
10 changed files with 11 additions and 11 deletions

View file

@ -94,7 +94,7 @@ func readTrace(r io.Reader) ([]rawEvent, error) {
if off != 16 || err != nil {
return nil, fmt.Errorf("failed to read header: read %v, err %v", off, err)
}
if bytes.Compare(buf[:], []byte("go 1.5 trace\x00\x00\x00\x00")) != 0 {
if !bytes.Equal(buf[:], []byte("go 1.5 trace\x00\x00\x00\x00")) {
return nil, fmt.Errorf("not a trace file")
}