Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore: update implementation
  • Loading branch information
ldez committed Mar 12, 2026
commit 9f85824ddb82b71138aa53373aa8e7c9863b0c42
6 changes: 2 additions & 4 deletions pkg/golinters/modernize/testdata/fix/out/fmtappendf.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ func comma() {
type S struct{ Bytes []byte }
var _ = struct{ A S }{
A: S{
Bytes: // want "Replace .*Sprint.* with fmt.Appendf"
fmt.Appendf(nil, "%d", 0),
Bytes: fmt.Appendf(nil, "%d", 0),
},
}
_ = // want "Replace .*Sprint.* with fmt.Appendf"
fmt.Appendf(nil, "%d", 0)
_ = fmt.Appendf(nil, "%d", 0)
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func _() {
}
var ok bool // define an ok variable to test the fix won't shadow it for its if stmt body
_ = ok
if after, ok0 := strings.CutPrefix(s, pre); ok0 { // want "TrimPrefix can be simplified to CutPrefix"
if after, ok := strings.CutPrefix(s, pre); ok { // want "TrimPrefix can be simplified to CutPrefix"
println(after)
}
var predefined string
Expand Down
Loading