Debian Codegraph @

go/analysis/passes/modernize/testdata/src/stringscutprefix/bytescutprefix/bytescutprefix.go.golden

raw
1 package bytescutprefix
2
3 import (
4 "bytes"
5 )
6
7 func _() {
8 if after, ok := bytes.CutPrefix(bss, bspre); ok { // want "HasPrefix \\+ TrimPrefix can be simplified to CutPrefix"
9 a := after
10 _ = a
11 }
12 if after, ok := bytes.CutPrefix([]byte(""), []byte("")); ok { // want "HasPrefix \\+ TrimPrefix can be simplified to CutPrefix"
13 a := after
14 _ = a
15 }
16
17 if before, ok := bytes.CutSuffix(bss, bssuf); ok { // want "HasSuffix \\+ TrimSuffix can be simplified to CutSuffix"
18 a := before
19 _ = a
20 }
21 if before, ok := bytes.CutSuffix([]byte(""), []byte("")); ok { // want "HasSuffix \\+ TrimSuffix can be simplified to CutSuffix"
22 a := before
23 _ = a
24 }
25 }