We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
staticcheck 2023.1.7 (v0.4.7)
staticcheck 2023.1.7 (v0.4.7) Compiled with Go version: go1.21.1 Main module: honnef.co/go/tools@v0.4.7 (sum: h1:9MDAWxMoSnB6QoSqiVr7P5mtkT9pOc1kSxchzPCnqJs=) Dependencies: github.com/BurntSushi/toml@v1.2.1 (sum: h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=) golang.org/x/exp/typeparams@v0.0.0-20221208152030-732eee02a75a (sum: h1:Jw5wfR+h9mnIYH+OtGT2im5wV1YGGDora5vTv/aa5bE=) golang.org/x/mod@v0.12.0 (sum: h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=) golang.org/x/sys@v0.11.0 (sum: h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=) golang.org/x/tools@v0.12.1-0.20230825192346-2191a27a6dc5 (sum: h1:Vk4mysSz+GqQK2eqgWbo4zEO89wkeAjJiFIr9bpqa8k=)
go version go1.21.1 darwin/arm64
GO111MODULE='' GOARCH='arm64' GOBIN='' GOCACHE='/Users/seiya/Library/Caches/go-build' GOENV='/Users/seiya/Library/Application Support/go/env' GOEXE='' GOEXPERIMENT='' GOFLAGS='' GOHOSTARCH='arm64' GOHOSTOS='darwin' GOINSECURE='' GOMODCACHE='/Users/seiya/.asdf/installs/golang/1.21.1/packages/pkg/mod' GONOPROXY='' GONOSUMDB='' GOOS='darwin' GOPATH='/Users/seiya/.asdf/installs/golang/1.21.1/packages' GOPRIVATE='' GOPROXY='https://proxy.golang.org,direct' GOROOT='/Users/seiya/.asdf/installs/golang/1.21.1/go' GOSUMDB='sum.golang.org' GOTMPDIR='' GOTOOLCHAIN='auto' GOTOOLDIR='/Users/seiya/.asdf/installs/golang/1.21.1/go/pkg/tool/darwin_arm64' GOVCS='' GOVERSION='go1.21.1' GCCGO='gccgo' AR='ar' CC='clang' CXX='clang++' CGO_ENABLED='1' GOMOD='/Users/seiya/Projects/repro/staticcheck-fixture/go.mod' GOWORK='' CGO_CFLAGS='-O2 -g' CGO_CPPFLAGS='' CGO_CXXFLAGS='-O2 -g' CGO_FFLAGS='-O2 -g' CGO_LDFLAGS='-O2 -g' PKG_CONFIG='pkg-config' GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/wb/yt882gm52pzdsz3_vcvbp_f80000gn/T/go-build869543369=/tmp/go-build -gno-record-gcc-switches -fno-common'
staticcheck ./
main.go:13:6: func fn2 is unused (U1000)
(fn1 should also be detected)
package main func main() { var fn1 func(int) fn1 = func(i int) { if i < 0 { return } fn1(i-1) } } func fn2(i int) { if i < 0 { return } fn2(i-1) }
The text was updated successfully, but these errors were encountered:
I'm afraid this is outside of unused's domain.Syntactically, fn1 is used. We could check for this in some other check, though.
unused
Sorry, something went wrong.
No branches or pull requests
(fn1 should also be detected)
The text was updated successfully, but these errors were encountered: