Debian Codegraph @

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

raw
1 package bytescutprefix
2
3 import (
4 . "bytes"
5 )
6
7 var bss, bspre, bssuf []byte
8
9 // test supported cases of pattern 1
10 func _() {
11 if HasPrefix(bss, bspre) { // want "HasPrefix \\+ TrimPrefix can be simplified to CutPrefix"
12 a := TrimPrefix(bss, bspre)
13 _ = a
14 }
15
16 if HasSuffix(bss, bssuf) { // want "HasSuffix \\+ TrimSuffix can be simplified to CutSuffix"
17 b := TrimSuffix(bss, bssuf)
18 _ = b
19 }
20 }