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
/var/folders/p8/jznrcvb54gl91s6fg50bznhm0000gn/T/try-go
❯ golangci-lint run
main.go:4:2: SA5002: this loop will spin, using 100% CPU (staticcheck)
for {
^
When I run golangci-lint run $PWD, resolved to golangci-lint run /var/folders/p8/jznrcvb54gl91s6fg50bznhm0000gn/T/try-go, same output.
Running golangci-lint run /private/var/folders/p8/jznrcvb54gl91s6fg50bznhm0000gn/T/try-go produces error output:
/var/folders/p8/jznrcvb54gl91s6fg50bznhm0000gn/T/try-go
❯ golangci-lint run /private/var/folders/p8/jznrcvb54gl91s6fg50bznhm0000gn/T/try-go
ERRO [linters_context] typechecking error: directory /private/var/folders/p8/jznrcvb54gl91s6fg50bznhm0000gn/T/try-go outside main module or its selected dependencies
Version of golangci-lint
$ golangci-lint --versiongolangci-lint has version 1.54.2 built with go1.21.0 from 411e0bbb on 2023-08-21T12:04:32Z
Configuration
golangci-lint run /private/var/folders/p8/jznrcvb54gl91s6fg50bznhm0000gn/T/try-gogolangci-lint run $PWD # golangci-lint run /var/folders/p8/jznrcvb54gl91s6fg50bznhm0000gn/T/try-gogolangci-lint run
Go environment
$ go version && go envgo version go1.21.1 darwin/arm64GO111MODULE=''GOARCH='arm64'GOBIN=''GOCACHE='/Users/artyom/Library/Caches/go-build'GOENV='/Users/artyom/Library/Application Support/go/env'GOEXE=''GOEXPERIMENT=''GOFLAGS=''GOHOSTARCH='arm64'GOHOSTOS='darwin'GOINSECURE=''GOMODCACHE='/Users/artyom/go/pkg/mod'GONOPROXY=''GONOSUMDB=''GOOS='darwin'GOPATH='/Users/artyom/go'GOPRIVATE=''GOPROXY='https://proxy.golang.org,direct'GOROOT='/usr/local/go'GOSUMDB='sum.golang.org'GOTMPDIR=''GOTOOLCHAIN='auto'GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64'GOVCS=''GOVERSION='go1.21.1'GCCGO='gccgo'AR='ar'CC='clang'CXX='clang++'CGO_ENABLED='1'GOMOD='/var/folders/p8/jznrcvb54gl91s6fg50bznhm0000gn/T/try-go/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/p8/jznrcvb54gl91s6fg50bznhm0000gn/T/go-build3756480822=/tmp/go-build -gno-record-gcc-switches -fno-common'
Verbose output of running
$ golangci-lint cache clean
$ golangci-lint run -v /private/var/folders/p8/jznrcvb54gl91s6fg50bznhm0000gn/T/try-goINFO [config_reader] Config search paths: [./ /private/var/folders/p8/jznrcvb54gl91s6fg50bznhm0000gn/T/try-go /private/var/folders/p8/jznrcvb54gl91s6fg50bznhm0000gn/T /private/var/folders/p8/jznrcvb54gl91s6fg50bznhm0000gn /private/var/folders/p8 /private/var/folders /private/var /private / /Users/artyom]INFO [lintersdb] Active 6 linters: [errcheck gosimple govet ineffassign staticcheck unused]INFO [loader] Go packages loading at mode 575 (files|types_sizes|compiled_files|exports_file|name|deps|imports) took 16.749333msINFO [runner/filename_unadjuster] Pre-built 0 adjustments in 5.542µsERRO [linters_context] typechecking error: directory /private/var/folders/p8/jznrcvb54gl91s6fg50bznhm0000gn/T/try-go outside main module or its selected dependenciesINFO [linters_context/goanalysis] analyzers took 1.691623ms with top 10 stages: fact_deprecated: 292.625µs, buildir: 264.084µs, SA3000: 130.375µs, SA5002: 128.334µs, ctrlflow: 117.584µs, cgocall: 95.625µs, isgenerated: 91.5µs, SA4024: 73.917µs, ineffassign: 69.042µs, buildtag: 51.291µsINFO [runner] processing took 1.125µs with stages: max_same_issues: 292ns, skip_dirs: 167ns, skip_files: 125ns, nolint: 83ns, cgo: 83ns, path_prettifier: 42ns, max_per_file_from_linter: 42ns, path_prefixer: 42ns, exclude-rules: 42ns, max_from_linter: 42ns, sort_results: 42ns, identifier_marker: 41ns, exclude: 41ns, autogenerated_exclude: 41ns, filename_unadjuster: 0s, fixer: 0s, source_code: 0s, severity-rules: 0s, path_shortener: 0s, diff: 0s, uniq_by_line: 0sINFO [runner] linters took 11.187875ms with stages: goanalysis_metalinter: 11.169083msINFO File cache stats: 0 entries of total size 0BINFO Memory: 2 samples, avg is 25.3MB, max is 27.4MBINFO Execution took 33.295ms
$ golangci-lint run -v $PWDINFO [config_reader] Config search paths: [./ /var/folders/p8/jznrcvb54gl91s6fg50bznhm0000gn/T/try-go /var/folders/p8/jznrcvb54gl91s6fg50bznhm0000gn/T /var/folders/p8/jznrcvb54gl91s6fg50bznhm0000gn /var/folders/p8 /var/folders /var / /Users/artyom]INFO [lintersdb] Active 6 linters: [errcheck gosimple govet ineffassign staticcheck unused]INFO [loader] Go packages loading at mode 575 (compiled_files|files|imports|deps|exports_file|name|types_sizes) took 37.641792msINFO [runner/filename_unadjuster] Pre-built 0 adjustments in 101µsINFO [linters_context/goanalysis] analyzers took 8.925972ms with top 10 stages: fact_purity: 472.75µs, buildir: 470.833µs, SA5012: 455.417µs, typedness: 427.334µs, SA6000: 390.958µs, nilness: 371.375µs, fact_deprecated: 361.417µs, SA9003: 269.75µs, SA4006: 254.667µs, ctrlflow: 244.292µsINFO [runner] Processors filtering stat (out/in): nolint: 1/1, diff: 1/1, max_from_linter: 1/1, path_shortener: 1/1, source_code: 1/1, path_prefixer: 1/1, sort_results: 1/1, skip_dirs: 1/1, identifier_marker: 1/1, exclude-rules: 1/1, max_per_file_from_linter: 1/1, uniq_by_line: 1/1, fixer: 1/1, path_prettifier: 1/1, skip_files: 1/1, autogenerated_exclude: 1/1, exclude: 1/1, cgo: 1/1, filename_unadjuster: 1/1, max_same_issues: 1/1, severity-rules: 1/1INFO [runner] processing took 133.125µs with stages: path_prettifier: 27.333µs, identifier_marker: 23.208µs, exclude-rules: 21.291µs, autogenerated_exclude: 17.001µs, nolint: 16µs, source_code: 11.125µs, skip_dirs: 7.542µs, filename_unadjuster: 3.333µs, uniq_by_line: 2.542µs, skip_files: 792ns, max_same_issues: 792ns, cgo: 500ns, path_shortener: 417ns, max_from_linter: 334ns, severity-rules: 209ns, exclude: 207ns, fixer: 166ns, max_per_file_from_linter: 125ns, diff: 125ns, sort_results: 83ns, path_prefixer: 0sINFO [runner] linters took 16.403084ms with stages: goanalysis_metalinter: 16.230709msmain.go:4:2: SA5002: this loop will spin, using 100% CPU (staticcheck) for { ^INFO File cache stats: 1 entries of total size 40BINFO Memory: 2 samples, avg is 25.5MB, max is 27.7MBINFO Execution took 59.791833ms
A minimal reproducible example or link to a public repository
main.go:
package main
funcmain() {
for {
}
}
go.mod:
moduletry-gogo1.21.1
Validation
Yes, I've included all information above (version, config, etc.).
The text was updated successfully, but these errors were encountered:
Welcome
Description of the problem
I have the following structure inside macOS temp directory (
/var/folders/p8/jznrcvb54gl91s6fg50bznhm0000gn/T/
in my case):main.go
:When I run
golangci-lint run
, it works okay:When I run
golangci-lint run $PWD
, resolved togolangci-lint run /var/folders/p8/jznrcvb54gl91s6fg50bznhm0000gn/T/try-go
, same output.Now the same directory with resolved symlink:
Running
golangci-lint run /private/var/folders/p8/jznrcvb54gl91s6fg50bznhm0000gn/T/try-go
produces error output:Version of golangci-lint
Configuration
Go environment
Verbose output of running
A minimal reproducible example or link to a public repository
main.go
:go.mod
:Validation
The text was updated successfully, but these errors were encountered: