mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
42d6294694
commit
1cb3044c9f
10 changed files with 11 additions and 11 deletions
|
|
@ -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")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue