You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#16 fails to consider cases where the one arguments is referenced multiple times:
package main
import"fmt"funcmain() {
_=fmt.Sprintf("You say %[1]s, I also say %[1]s", "hello")
}
Using the version before the PR mentioned above, there is no change as positional arguments weren't supported.
$ go install github.com/catenacyber/perfsprint@v0.4.0
$ perfsprint --fix ./...
Using a the latest version (i.e. after the PR was merged) it detects and gives an inccorrect suggested "fix":
$ go install github.com/catenacyber/perfsprint@v0.7.0
$ perfsprint --fix ./...test/main.go:6:7: fmt.Sprintf can be replaced with string concatenationtest/main.go:3:8: Fix imports
The fix is:
package main
import
func main() {
_ = "You say %[1]s, I also say "+"hello"
}
Given this is not a simple concatenation I would expect this to just not be flagged by perfsprint.
The text was updated successfully, but these errors were encountered:
#16 fails to consider cases where the one arguments is referenced multiple times:
Using the version before the PR mentioned above, there is no change as positional arguments weren't supported.
Using a the latest version (i.e. after the PR was merged) it detects and gives an inccorrect suggested "fix":
The fix is:
Given this is not a simple concatenation I would expect this to just not be flagged by perfsprint.
The text was updated successfully, but these errors were encountered: