Debian Codegraph @

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

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 after, ok := CutPrefix(bss, bspre); ok { // want "HasPrefix \\+ TrimPrefix can be simplified to CutPrefix"
12 a := after
13 _ = a
14 }
15
16 if before, ok := CutSuffix(bss, bssuf); ok { // want "HasSuffix \\+ TrimSuffix can be simplified to CutSuffix"
17 b := before
18 _ = b
19 }
20 }