Closed Vishal1297 closed 3 months ago
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.
Hello,
It's not related to the severity but to the option issues.new
.
issues:
new: true
This option hides the reports that are already known. This is the expected behavior.
$ docker run --rm -it golang:1.21-alpine sh
/go # apk add -q git curl
/go # curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.59.1
golangci/golangci-lint info checking GitHub for tag 'v1.59.1'
golangci/golangci-lint info found version: 1.59.1 for v1.59.1/linux/amd64
golangci/golangci-lint info installed /go/bin/golangci-lint
/go # git clone --quiet https://github.com/Vishal1297/graphql-go.git
/go # cd graphql-go
/go/graphql-go # git switch vishal/try-golangci-lint
branch 'vishal/try-golangci-lint' set up to track 'origin/vishal/try-golangci-lint'.
Switched to a new branch 'vishal/try-golangci-lint'
/go/graphql-go # golangci-lint run
main.go:6:8: Error return value is not checked (errcheck)
myFunc()
^
main.go:5:6: func `main` is unused (unused)
func main() {
^
main.go:9:6: func `myFunc` is unused (unused)
func myFunc() error {
^
main.go:13:6: func `call` is unused (unused)
func call() error {
^
/go/graphql-go # golangci-lint run
/go/graphql-go # golangci-lint run
/go/graphql-go # golangci-lint run --new=false
main.go:6:8: Error return value is not checked (errcheck)
myFunc()
^
main.go:5:6: func `main` is unused (unused)
func main() {
^
main.go:9:6: func `myFunc` is unused (unused)
func myFunc() error {
^
main.go:13:6: func `call` is unused (unused)
func call() error {
^
example/enum/main.go:53:77: Error return value of `w.Write` is not checked (errcheck)
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.Write(page) })
^
example/caching/server/server.go:22:10: Error return value of `w.Write` is not checked (errcheck)
w.Write(page)
^
example/caching/server/server.go:60:9: Error return value of `w.Write` is not checked (errcheck)
w.Write(responseJSON)
^
/go/graphql-go #
Welcome
typecheck
section of the FAQ.Description of the problem
Hi,
I am trying golangici-lint after a long time on a sample code in pushed to a branch. After adding the code, I tried running the golangci-lint but it fails to report issues when I mention default severity.
Version of golangci-lint
Configuration
Go environment
Verbose output of running
A minimal reproducible example or link to a public repository
Validation
Supporter