-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Description
package sandbox
import (
"fmt"
"net/http"
)
func Foo(resp *http.Response) {
if resp.StatusCode/100 != 2 {
fmt.Println("foo")
}
if resp.StatusCode+100 != 2 {
fmt.Println("foo")
}
if resp.StatusCode-100 != 2 {
fmt.Println("foo")
}
if resp.StatusCode*100 != 2 {
fmt.Println("foo")
}
}
$ ggolangci-lint run --enable-only usestdlibvars --max-same-issues 0
main.go:9:21: "100" can be replaced by http.StatusContinue (usestdlibvars)
--max-saif resp.StatusCode/100 != 2 {ount of issues with the same text. Set to 0 to disable
^
main.go:12:21: "100" can be replaced by http.StatusContinue (usestdlibvars)
if resp.StatusCode+100 != 2 {
^
main.go:15:21: "100" can be replaced by http.StatusContinue (usestdlibvars)
if resp.StatusCode-100 != 2 {
^
main.go:18:21: "100" can be replaced by http.StatusContinue (usestdlibvars)
if resp.StatusCode*100 != 2 {
^
ccoVeille
Metadata
Metadata
Assignees
Labels
No labels