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