Skip to content
New issue

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

Build errors with 1.18rc1 #2619

Closed
4 tasks done
bufdev opened this issue Feb 24, 2022 · 2 comments
Closed
4 tasks done

Build errors with 1.18rc1 #2619

bufdev opened this issue Feb 24, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@bufdev
Copy link

bufdev commented Feb 24, 2022

Welcome

  • Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).
  • Yes, I've tried with the standalone linter if available. (https://golangci-lint.run/usage/linters/)

Description of the problem

golangci-lint has multiple errors with 1.18rc1 - I've copied the first below, along with a minimal reproducible file

Version of golangci-lint

$ golangci-lint --version
golangci-lint has version v1.44.2 built from (unknown, mod sum: "h1:MzvkDt1j1OHkv42/feNJVNNXRFACPp7aAWBWDo5aYQw=") on (unknown)

Configuration file

Empty:

$ cat .golangci.yml

Go environment

$ go version && go env
go version go1.18rc1 darwin/amd64
GO111MODULE="on"
GOARCH="amd64"
GOBIN="/Users/alice/go/bin"
GOCACHE="/Users/alice/Library/Caches/go-build"
GOENV="/Users/alice/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/alice/go/pkg/mod"
GONOPROXY="github.com/bufdev"
GONOSUMDB="github.com/bufdev"
GOOS="darwin"
GOPATH="/Users/alice/go"
GOPRIVATE="github.com/bufdev"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/alice/.cache/gimme/versions/go1.18rc1.darwin.amd64"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/alice/.cache/gimme/versions/go1.18rc1.darwin.amd64/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.18rc1"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/alice/tmp/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/gl/rk7vtj290lx0pq64kdtasd24lknlnkasdv/T/go-build3199327674=/tmp/go-build -gno-record-gcc-switches -fno-common"

Verbose output of running

$ golangci-lint cache clean
$ golangci-lint run -v
INFO [config_reader] Config search paths: [./ /Users/alice/tmp /Users/alice /Users /]
INFO [config_reader] Used config file .golangci.yml
INFO [lintersdb] Active 10 linters: [deadcode errcheck gosimple govet ineffassign staticcheck structcheck typecheck unused varcheck]
INFO [loader] Go packages loading at mode 575 (deps|exports_file|files|types_sizes|compiled_files|imports|name) took 26.218852ms
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 159.637µs
INFO [linters context/goanalysis] analyzers took 80.98404ms with top 10 stages: ctrlflow: 1.952209ms, fact_deprecated: 1.946466ms, S1016: 1.673439ms, testinggoroutine: 1.656626ms, SA1005: 1.647715ms, S1001: 1.647116ms, SA3000: 1.644546ms, S1005: 1.642674ms, S1035: 1.641256ms, SA4025: 1.638109ms
ERRO [runner] Panic: S1029: package "foo" (isInitialPkg: true, needAnalyzeSource: true): interface conversion: interface {} is nil, not *buildir.IR: goroutine 739 [running]:
runtime/debug.Stack()
	/Users/alice/.cache/gimme/versions/go1.18rc1.darwin.amd64/src/runtime/debug/stack.go:24 +0x65
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func1()
	/Users/alice/go/pkg/mod/github.com/golangci/golangci-lint@v1.44.2/pkg/golinters/goanalysis/runner_action.go:101 +0x155
panic({0x4b74ee0, 0xc0007f7980})
	/Users/alice/.cache/gimme/versions/go1.18rc1.darwin.amd64/src/runtime/panic.go:838 +0x207
honnef.co/go/tools/internal/sharedcheck.CheckRangeStringRunes(0xc000989790)
	/Users/alice/go/pkg/mod/honnef.co/go/tools@v0.2.2/internal/sharedcheck/lint.go:23 +0x17b
honnef.co/go/tools/simple.CheckRangeStringRunes(0x4b568e0?)
	/Users/alice/go/pkg/mod/honnef.co/go/tools@v0.2.2/simple/lint.go:1513 +0x19
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyze(0xc0009b6870)
	/Users/alice/go/pkg/mod/github.com/golangci/golangci-lint@v1.44.2/pkg/golinters/goanalysis/runner_action.go:187 +0x9c4
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func2()
	/Users/alice/go/pkg/mod/github.com/golangci/golangci-lint@v1.44.2/pkg/golinters/goanalysis/runner_action.go:105 +0x1d
github.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0xc000291590, {0x4c8bc78, 0x5}, 0xc000a4ff48)
	/Users/alice/go/pkg/mod/github.com/golangci/golangci-lint@v1.44.2/pkg/timeutils/stopwatch.go:111 +0x4a
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe(0x61747369726b2220?)
	/Users/alice/go/pkg/mod/github.com/golangci/golangci-lint@v1.44.2/pkg/golinters/goanalysis/runner_action.go:104 +0x85
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze.func2(0xc0009b6870)
	/Users/alice/go/pkg/mod/github.com/golangci/golangci-lint@v1.44.2/pkg/golinters/goanalysis/runner_loadingpackage.go:80 +0xb4
created by github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze
	/Users/alice/go/pkg/mod/github.com/golangci/golangci-lint@v1.44.2/pkg/golinters/goanalysis/runner_loadingpackage.go:75 +0x1eb
WARN [runner] Can't run linter goanalysis_metalinter: goanalysis_metalinter: S1029: package "foo" (isInitialPkg: true, needAnalyzeSource: true): interface conversion: interface {} is nil, not *buildir.IR
INFO [runner] processing took 10.561µs with stages: max_same_issues: 5.269µs, skip_dirs: 672ns, max_from_linter: 570ns, nolint: 466ns, cgo: 336ns, path_prettifier: 281ns, autogenerated_exclude: 279ns, filename_unadjuster: 279ns, skip_files: 274ns, uniq_by_line: 272ns,exclude: 264ns, diff: 258ns, sort_results: 201ns, source_code: 177ns, max_per_file_from_linter: 167ns, path_shortener: 164ns, identifier_marker: 162ns, path_prefixer: 159ns, severity-rules: 157ns, exclude-rules: 154ns
INFO [runner] linters took 429.205195ms with stages: goanalysis_metalinter: 429.102871ms
ERRO Running error: 1 error occurred:
	* can't run linter goanalysis_metalinter: goanalysis_metalinter: S1029: package "foo" (isInitialPkg: true, needAnalyzeSource: true): interface conversion: interface {} is nil, not *buildir.IR

INFO Memory: 6 samples, avg is 46.7MB, max is 46.8MB
INFO Execution took 467.281798ms

Code example or link to a public repository

package foo

type Sender interface {
	Send(any) error
}

type Client[Req, Res any] struct {
	sender   Sender
}

func NewClient[Req, Res any](s Sender) *Client[Req, Res] {
	return &Client[Req, Res]{sender: s}
}

func (c *Client[Req, Res]) Send(msg *Req) error {
	return c.sender.Send(msg)
}
@bufdev bufdev added the bug Something isn't working label Feb 24, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Feb 24, 2022

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@ldez
Copy link
Member

ldez commented Feb 24, 2022

Hello,

currently, golangci-lint doesn't support go1.18.

you can follow this PR #2438

@ldez ldez closed this as completed Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants