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
|
|
@ -856,7 +856,7 @@ func (p *printer) marshalStruct(tinfo *typeInfo, val reflect.Value) error {
|
|||
}
|
||||
case reflect.Slice:
|
||||
b := vf.Bytes()
|
||||
dashDash = bytes.Index(b, ddBytes) >= 0
|
||||
dashDash = bytes.Contains(b, ddBytes)
|
||||
dashLast = b[len(b)-1] == '-'
|
||||
if !dashDash {
|
||||
p.Write(b)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue