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

golangci-lint unusable within Go 1.20 pre-release images #789

Closed
atc0005 opened this issue Dec 12, 2022 · 7 comments · Fixed by #808
Closed

golangci-lint unusable within Go 1.20 pre-release images #789

atc0005 opened this issue Dec 12, 2022 · 7 comments · Fixed by #808
Assignees
Labels
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Dec 12, 2022

I updated the unstable image on Friday to use the latest Go 1.20rc1 base image. Since then, CI checks using that image have all failed due to golangci-lint flagging standard library source as failing the typecheck linter.

Example:

../../../usr/local/go/src/runtime/debuglog.go:296:20: StringData not declared by package unsafe (typecheck)
	strData := unsafe.StringData(x)
	                  ^
../../../usr/local/go/src/runtime/heapdump.go:159:37: StringData not declared by package unsafe (typecheck)
	dumpmemrange(unsafe.Pointer(unsafe.StringData(s)), uintptr(len(s)))
	                                   ^
../../../usr/local/go/src/runtime/heapdump.go:202:32: StringData not declared by package unsafe (typecheck)
		dwrite(unsafe.Pointer(unsafe.StringData(pkgpath)), uintptr(len(pkgpath)))
		                             ^
../../../usr/local/go/src/runtime/proc.go:65[8](https://github.com/atc0005/send2teams/actions/runs/3675230792/jobs/6214398690#step:5:9):16: String not declared by package unsafe (typecheck)
			s := unsafe.String(p, findnull(p))
			            ^
../../../usr/local/go/src/runtime/string.go:105:17: String not declared by package unsafe (typecheck)
		return unsafe.String((*byte)(p), 1)
		              ^
../../../usr/local/go/src/runtime/string.go:115:16: String not declared by package unsafe (typecheck)
	return unsafe.String((*byte)(p), n)
	              ^
../../../usr/local/go/src/flag/flag.go:421:17: invalid operation: cannot compare f.output == nil (operator == not defined on untyped nil) (typecheck)
	if f.output == nil {
	               ^
../../../usr/local/go/src/internal/fmtsort/sort.go:182:1: missing return (typecheck)
}
^
../../../usr/local/go/src/io/pipe.go:22:4: a.Lock undefined (type *onceError has no field or method Lock) (typecheck)
	a.Lock()
	  ^
../../../usr/local/go/src/io/pipe.go:23:10: a.Unlock undefined (type *onceError has no field or method Unlock) (typecheck)
	defer a.Unlock()
	        ^
../../../usr/local/go/src/io/pipe.go:30:4: a.Lock undefined (type *onceError has no field or method Lock) (typecheck)
	a.Lock()
	  ^
../../../usr/local/go/src/io/pipe.go:31:10: a.Unlock undefined (type *onceError has no field or method Unlock) (typecheck)
	defer a.Unlock()
	        ^
../../../usr/local/go/src/os/file_unix.go:416:15: invalid operation: cannot compare d.info != nil (operator != not defined on untyped nil) (typecheck)
	if d.info != nil {
	             ^
../../../usr/local/go/src/syscall/syscall_unix.go:63:4: m.Lock undefined (type *mmapper has no field or method Lock) (typecheck)
	m.Lock()
	  ^
../../../usr/local/go/src/syscall/syscall_unix.go:64:10: m.Unlock undefined (type *mmapper has no field or method Unlock) (typecheck)
	defer m.Unlock()
	        ^
../../../usr/local/go/src/syscall/syscall_unix.go:76:4: m.Lock undefined (type *mmapper has no field or method Lock) (typecheck)
	m.Lock()
	  ^
../../../usr/local/go/src/syscall/syscall_unix.go:77:10: m.Unlock undefined (type *mmapper has no field or method Unlock) (typecheck)
	defer m.Unlock()
	        ^
../../../usr/local/go/src/encoding/json/decode.go:161:15: invalid operation: cannot compare e.Type == nil (operator == not defined on untyped nil) (typecheck)
	if e.Type == nil {
	             ^
../../../usr/local/go/src/encoding/json/decode.go:254:56: invalid operation: cannot compare d.errorContext.Struct != nil (operator != not defined on untyped nil) (typecheck)
	if d.errorContext != nil && (d.errorContext.Struct != nil || len(d.errorContext.FieldStack) > 0) {
	                                                      ^
../../../usr/local/go/src/encoding/json/encode.go:165:31: e.Bytes undefined (type *encodeState has no field or method Bytes) (typecheck)
	buf := append([]byte(nil), e.Bytes()...)
	                             ^
../../../usr/local/go/src/encoding/json/encode.go:464:4: e.WriteString undefined (type *encodeState has no field or method WriteString) (typecheck)
	e.WriteString("null")
	  ^
../../../usr/local/go/src/encoding/json/encode.go:46[9](https://github.com/atc0005/send2teams/actions/runs/3675230792/jobs/6214398690#step:5:10):5: e.WriteString undefined (type *encodeState has no field or method WriteString) (typecheck)
		e.WriteString("null")
		  ^
../../../usr/local/go/src/encoding/json/encode.go:474:5: e.WriteString undefined (type *encodeState has no field or method WriteString) (typecheck)
		e.WriteString("null")
		  ^
../../../usr/local/go/src/encoding/json/encode.go:537:5: e.WriteByte undefined (type *encodeState has no field or method WriteByte) (typecheck)
		e.WriteByte('"')
		  ^
../../../usr/local/go/src/encoding/json/encode.go:545:5: e.WriteByte undefined (type *encodeState has no field or method WriteByte) (typecheck)
		e.WriteByte('"')
		  ^
../../../usr/local/go/src/encoding/json/encode.go:552:5: e.WriteByte undefined (type *encodeState has no field or method WriteByte) (typecheck)
		e.WriteByte('"')
		  ^
../../../usr/local/go/src/encoding/json/encode.go:554:4: e.Write undefined (type *encodeState has no field or method Write) (typecheck)
	e.Write(b)
	  ^
../../../usr/local/go/src/encoding/json/encode.go:565:4: e.Write undefined (type *encodeState has no field or method Write) (typecheck)
	e.Write(b)
	  ^
../../../usr/local/go/src/encoding/json/encode.go:606:4: e.Write undefined (type *encodeState has no field or method Write) (typecheck)
	e.Write(b)
	  ^
../../../usr/local/go/src/encoding/json/encode.go:642:20: e2.Bytes undefined (type *encodeState has no field or method Bytes) (typecheck)
		e.stringBytes(e2.Bytes(), false)
		                 ^
../../../usr/local/go/src/encoding/json/stream.go:222:9: e.Bytes undefined (type *encodeState has no field or method Bytes) (typecheck)
	b := e.Bytes()
	       ^
../../../usr/local/go/src/net/http/client.go:271:18: invalid operation: cannot compare resp.Body == nil (operator == not defined on untyped nil) (typecheck)
	if resp.Body == nil {
	                ^
../../../usr/local/go/src/net/http/fs.go:620:[10](https://github.com/atc0005/send2teams/actions/runs/3675230792/jobs/6214398690#step:5:11): f.Close undefined (type File has no field or method Close) (typecheck)
	defer f.Close()
	        ^
../../../usr/local/go/src/net/http/fs.go:658:13: ff.Close undefined (type File has no field or method Close) (typecheck)
			defer ff.Close()
			         ^
../../../usr/local/go/src/net/http/fs.go:890:20: missing type in composite literal (typecheck)
		"Content-Range": {r.contentRange(size)},
		                 ^
../../../usr/local/go/src/net/http/fs.go:891:20: missing type in composite literal (typecheck)
		"Content-Type":  {contentType},
		                 ^
../../../usr/local/go/src/net/http/h2_bundle.go:3678:15: p.b.Read undefined (type http2pipeBuffer has no field or method Read) (typecheck)
			return p.b.Read(d)
			           ^
../../../usr/local/go/src/net/http/h2_bundle.go:3710:13: p.b.Write undefined (type http2pipeBuffer has no field or method Write) (typecheck)
	return p.b.Write(d)
	           ^
../../../usr/local/go/src/net/http/h2_bundle.go:4101:30: invalid operation: cannot compare o.Context != nil (operator != not defined on untyped nil) (typecheck)
	if o != nil && o.Context != nil {
	                            ^
../../../usr/local/go/src/net/http/h2_bundle.go:7383:19: invalid operation: cannot compare cs.reqBody != nil (operator != not defined on untyped nil) (typecheck)
	if cs.reqBody != nil {
	                 ^
../../../usr/local/go/src/net/http/h2_bundle.go:7397:19: invalid operation: cannot compare cs.reqBody != nil (operator != not defined on untyped nil) (typecheck)
	if cs.reqBody != nil && cs.reqBodyClosed == nil {
	                 ^
../../../usr/local/go/src/net/http/h2_bundle.go:7578:17: invalid operation: cannot compare req.Body == nil (operator == not defined on untyped nil) (typecheck)
	if req.Body == nil || req.Body == NoBody {
	               ^
../../../usr/local/go/src/net/http/h2_bundle.go:8154:17: invalid operation: cannot compare req.Body == nil (operator == not defined on untyped nil) (typecheck)
	if req.Body == nil || req.Body == NoBody {
	               ^
../../../usr/local/go/src/net/http/h2_bundle.go:8478:19: invalid operation: cannot compare cs.reqBody != nil (operator != not defined on untyped nil) (typecheck)
	if cs.reqBody != nil && cs.reqBodyClosed == nil {
	                 ^
../../../usr/local/go/src/net/http/request.go:341:14: invalid operation: cannot compare r.ctx != nil (operator != not defined on untyped nil) (typecheck)
	if r.ctx != nil {
	            ^
../../../usr/local/go/src/net/http/request.go:486:15: invalid operation: cannot compare r.Body == nil (operator == not defined on untyped nil) (typecheck)
	if r.Body == nil {
	             ^
../../../usr/local/go/src/net/http/request.go:[12](https://github.com/atc0005/send2teams/actions/runs/3675230792/jobs/6214398690#step:5:13)19:[15](https://github.com/atc0005/send2teams/actions/runs/3675230792/jobs/6214398690#step:5:16): invalid operation: cannot compare r.Body == nil (operator == not defined on untyped nil) (typecheck)
	if r.Body == nil {
	             ^
../../../usr/local/go/src/net/http/request.go:1284:[19](https://github.com/atc0005/send2teams/actions/runs/3675230792/jobs/6214398690#step:5:20): invalid operation: cannot compare r.PostForm == nil (operator == not defined on untyped nil) (typecheck)
	if r.PostForm == nil {
	                 ^
../../../usr/local/go/src/net/http/request.go:1288:[20](https://github.com/atc0005/send2teams/actions/runs/3675230792/jobs/6214398690#step:5:21): invalid operation: cannot compare r.PostForm == nil (operator == not defined on untyped nil) (typecheck)
		if r.PostForm == nil {
		                 ^
../../../usr/local/go/src/net/http/request.go:1[29](https://github.com/atc0005/send2teams/actions/runs/3675230792/jobs/6214398690#step:5:30)2:15: invalid operation: cannot compare r.Form == nil (operator == not defined on untyped nil) (typecheck)
	if r.Form == nil {
	             ^

refs: https://github.com/atc0005/send2teams/actions/runs/3675230792/jobs/6214398690

@atc0005 atc0005 added bug Something isn't working unstable linting labels Dec 12, 2022
@atc0005 atc0005 added this to the Next Release milestone Dec 12, 2022
@atc0005 atc0005 self-assigned this Dec 12, 2022
@atc0005
Copy link
Owner Author

atc0005 commented Dec 12, 2022

When generics support was first added to linters for the Go 1.18 release a necessary step was to build/install the golangci-lint tool via go install instead of using the official installation script. It looks like that might be necessary here.

@atc0005
Copy link
Owner Author

atc0005 commented Dec 12, 2022

Testing:

index e71edbe..80f74a4 100644
--- a/unstable/Dockerfile
+++ b/unstable/Dockerfile
@@ -23,8 +23,7 @@ RUN echo "Installing staticcheck@${STATICCHECK_VERSION}" \
     && echo "Installing govulncheck@${GOVULNCHECK_VERSION}" \
     && go install golang.org/x/vuln/cmd/govulncheck@${GOVULNCHECK_VERSION} \
     && echo "Installing golangci-lint ${GOLANGCI_LINT_VERSION}" \
-    && curl -sSfLO https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
-    && sh install.sh -b "$(go env GOPATH)/bin" ${GOLANGCI_LINT_VERSION} \
+    && go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION} \
     && golangci-lint --version \
     && echo "Installing httperroryzer@${HTTPERRORYZER_VERSION}" \
     && go install github.com/orijtech/httperroryzer/cmd/httperroryzer@${HTTPERRORYZER_VERSION} \

@atc0005
Copy link
Owner Author

atc0005 commented Dec 12, 2022

That didn't go well.

# golangci-lint run
WARN [runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner.  Replaced by govet 'fieldalignment'. 
ERRO [runner] Panic: buildir: package "netip" (isInitialPkg: false, needAnalyzeSource: true): in net/netip.AddrFromSlice: cannot convert Load <[]byte> t0 ([]byte) to [4]byte: goroutine 1439 [running]:
runtime/debug.Stack()
	/usr/local/go/src/runtime/debug/stack.go:24 +0x65
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func1()
	/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.1/pkg/golinters/goanalysis/runner_action.go:102 +0x155
panic({0x14fd300, 0xc003b09560})
	/usr/local/go/src/runtime/panic.go:884 +0x213
honnef.co/go/tools/go/ir.emitConv(0xc0014bb400, {0x19386c8, 0xc001c10ea0}, {0x192bbb0?, 0xc003c02498}, {0x192b2a0, 0xc00281e780})
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/emit.go:293 +0xd29
honnef.co/go/tools/go/ir.(*builder).expr0(0xc002911a28, 0xc0014bb400, {0x192ef70?, 0xc00281e780?}, {0x7, {0x192bbb0, 0xc003c02498}, {0x0, 0x0}})
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:610 +0x5d7
honnef.co/go/tools/go/ir.(*builder).expr(0x192bd40?, 0xc0014bb400, {0x192ef70, 0xc00281e780})
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:566 +0x1fa
honnef.co/go/tools/go/ir.(*builder).emitCallArgs(0x192bd40?, 0xc0014bb400, 0xc003b69f40, 0xc00281e7c0, {0x0?, 0x0, 0x8b80a7?})
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:975 +0x135
honnef.co/go/tools/go/ir.(*builder).setCall(0x1566e20?, 0xc0014bb400, 0xc00281e7c0, 0xc00393b448)
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:1037 +0x8e
honnef.co/go/tools/go/ir.(*builder).expr0(0xc002911a28, 0xc0014bb400, {0x192ef70?, 0xc00281e7c0?}, {0x7, {0x192bca0, 0xc0001cd730}, {0x0, 0x0}})
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:623 +0x218e
honnef.co/go/tools/go/ir.(*builder).expr(0xc002910e78?, 0xc0014bb400, {0x192ef70, 0xc00281e7c0})
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:566 +0x1fa
honnef.co/go/tools/go/ir.(*builder).stmt(0xc0014bb400?, 0xc0014bb400, {0x192f4b0?, 0xc0016f6ca0?})
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2291 +0x194c
honnef.co/go/tools/go/ir.(*builder).stmtList(...)
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:855
honnef.co/go/tools/go/ir.(*builder).switchStmt(0xc002911308?, 0xc0014bb400, 0xc00bb9cc60, 0x0)
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:1366 +0x19a5
honnef.co/go/tools/go/ir.(*builder).stmt(0x20?, 0xc0014bb400, {0x192f600?, 0xc00bb9cc60?})
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2365 +0x121c
honnef.co/go/tools/go/ir.(*builder).stmtList(0x8bea25?, 0xc0029114f8?, {0xc0016f6e60?, 0x2, 0x8c0630?})
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:855 +0x45
honnef.co/go/tools/go/ir.(*builder).stmt(0xc0014bb400?, 0xc0014bb400, {0x192ef10?, 0xc00bb9cc90?})
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2338 +0x9b9
honnef.co/go/tools/go/ir.(*builder).buildFunction(0xc002911a28, 0xc0014bb400)
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2450 +0x3d7
honnef.co/go/tools/go/ir.(*builder).buildFuncDecl(0x0?, 0xc000309050, 0xc00bb9ccc0)
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2488 +0x19b
honnef.co/go/tools/go/ir.(*Package).build(0xc000309050)
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2594 +0xc16
sync.(*Once).doSlow(0xc001dd81c0?, 0xc00cb31720?)
	/usr/local/go/src/sync/once.go:74 +0xc2
sync.(*Once).Do(...)
	/usr/local/go/src/sync/once.go:65
honnef.co/go/tools/go/ir.(*Package).Build(...)
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2512
honnef.co/go/tools/internal/passes/buildir.run(0xc0017d5ba0)
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/internal/passes/buildir/buildir.go:86 +0x368
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyze(0xc002793730)
	/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.1/pkg/golinters/goanalysis/runner_action.go:188 +0x9d6
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func2()
	/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.1/pkg/golinters/goanalysis/runner_action.go:106 +0x1d
github.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0xc00255e820, {0x16c8b40, 0x7}, 0xc00215cf48)
	/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.1/pkg/timeutils/stopwatch.go:111 +0x4a
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe(0xc00219bb00?)
	/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.1/pkg/golinters/goanalysis/runner_action.go:105 +0x85
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze.func2(0xc002793730)
	/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.1/pkg/golinters/goanalysis/runner_loadingpackage.go:80 +0xb4
created by github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze
	/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.1/pkg/golinters/goanalysis/runner_loadingpackage.go:75 +0x1eb 
WARN [runner] Can't run linter goanalysis_metalinter: goanalysis_metalinter: buildir: package "netip" (isInitialPkg: false, needAnalyzeSource: true): in net/netip.AddrFromSlice: cannot convert Load <[]byte> t0 ([]byte) to [4]byte 
ERRO Running error: 1 error occurred:
	* can't run linter goanalysis_metalinter: goanalysis_metalinter: buildir: package "netip" (isInitialPkg: false, needAnalyzeSource: true): in net/netip.AddrFromSlice: cannot convert Load <[]byte> t0 ([]byte) to [4]byte

@atc0005
Copy link
Owner Author

atc0005 commented Dec 12, 2022

Going to try installing golangci-lint from master branch to see if that makes a difference.

@atc0005
Copy link
Owner Author

atc0005 commented Dec 12, 2022

Going to try installing golangci-lint from master branch to see if that makes a difference.

Still issues running the tool from the master branch.

I also nuked the .golangci.yml files from the project I was evaluating and the image root to rule out using non-default linters:

# golangci-lint run
ERRO [runner] Panic: buildir: package "netip" (isInitialPkg: false, needAnalyzeSource: true): in net/netip.AddrFromSlice: cannot convert Load <[]byte> t0 ([]byte) to [4]byte: goroutine 1083 [running]:
runtime/debug.Stack()
	/usr/local/go/src/runtime/debug/stack.go:24 +0x65
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func1()
	/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.2-0.20221211114606-b2462ed75201/pkg/golinters/goanalysis/runner_action.go:102 +0x155
panic({0x1509960, 0xc0003dce10})
	/usr/local/go/src/runtime/panic.go:884 +0x213
honnef.co/go/tools/go/ir.emitConv(0xc0000a5400, {0x19475a8, 0xc000e6de00}, {0x193aa78?, 0xc0019f5230}, {0x193a168, 0xc0018ce280})
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/emit.go:293 +0xd29
honnef.co/go/tools/go/ir.(*builder).expr0(0xc00032ba28, 0xc0000a5400, {0x193de30?, 0xc0018ce280?}, {0x7, {0x193aa78, 0xc0019f5230}, {0x0, 0x0}})
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:610 +0x5d7
honnef.co/go/tools/go/ir.(*builder).expr(0x193ac08?, 0xc0000a5400, {0x193de30, 0xc0018ce280})
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:566 +0x1fa
honnef.co/go/tools/go/ir.(*builder).emitCallArgs(0x193ac08?, 0xc0000a5400, 0xc0019bf680, 0xc0018ce2c0, {0x0?, 0x0, 0x8bb0a7?})
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:975 +0x135
honnef.co/go/tools/go/ir.(*builder).setCall(0x1573640?, 0xc0000a5400, 0xc0018ce2c0, 0xc0005b9628)
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:1037 +0x8e
honnef.co/go/tools/go/ir.(*builder).expr0(0xc00032ba28, 0xc0000a5400, {0x193de30?, 0xc0018ce2c0?}, {0x7, {0x193ab68, 0xc00189e620}, {0x0, 0x0}})
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:623 +0x218e
honnef.co/go/tools/go/ir.(*builder).expr(0xc00032ae78?, 0xc0000a5400, {0x193de30, 0xc0018ce2c0})
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:566 +0x1fa
honnef.co/go/tools/go/ir.(*builder).stmt(0xc0000a5400?, 0xc0000a5400, {0x193e370?, 0xc0018cd580?})
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2291 +0x194c
honnef.co/go/tools/go/ir.(*builder).stmtList(...)
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:855
honnef.co/go/tools/go/ir.(*builder).switchStmt(0xc00032b308?, 0xc0000a5400, 0xc0018c7ce0, 0x0)
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:1366 +0x19a5
honnef.co/go/tools/go/ir.(*builder).stmt(0x20?, 0xc0000a5400, {0x193e4c0?, 0xc0018c7ce0?})
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2365 +0x121c
honnef.co/go/tools/go/ir.(*builder).stmtList(0x8c1a25?, 0xc00032b4f8?, {0xc0018cd740?, 0x2, 0x8c3630?})
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:855 +0x45
honnef.co/go/tools/go/ir.(*builder).stmt(0xc0000a5400?, 0xc0000a5400, {0x193ddd0?, 0xc0018c7d10?})
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2338 +0x9b9
honnef.co/go/tools/go/ir.(*builder).buildFunction(0xc00032ba28, 0xc0000a5400)
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2450 +0x3d7
honnef.co/go/tools/go/ir.(*builder).buildFuncDecl(0x0?, 0xc0003025a0, 0xc0018c7d40)
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2488 +0x19b
honnef.co/go/tools/go/ir.(*Package).build(0xc0003025a0)
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2594 +0xc16
sync.(*Once).doSlow(0xc0016fe0e0?, 0xc0019b9b30?)
	/usr/local/go/src/sync/once.go:74 +0xc2
sync.(*Once).Do(...)
	/usr/local/go/src/sync/once.go:65
honnef.co/go/tools/go/ir.(*Package).Build(...)
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2512
honnef.co/go/tools/internal/passes/buildir.run(0xc00049e3c0)
	/go/pkg/mod/honnef.co/go/tools@v0.3.3/internal/passes/buildir/buildir.go:86 +0x368
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyze(0xc00103e150)
	/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.2-0.20221211114606-b2462ed75201/pkg/golinters/goanalysis/runner_action.go:188 +0x9df
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func2()
	/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.2-0.20221211114606-b2462ed75201/pkg/golinters/goanalysis/runner_action.go:106 +0x1d
github.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0xc000f76ff0, {0x16d616e, 0x7}, 0xc0011c6748)
	/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.2-0.20221211114606-b2462ed75201/pkg/timeutils/stopwatch.go:111 +0x4a
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe(0xc00075d440?)
	/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.2-0.20221211114606-b2462ed75201/pkg/golinters/goanalysis/runner_action.go:105 +0x85
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze.func2(0xc00103e150)
	/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.2-0.20221211114606-b2462ed75201/pkg/golinters/goanalysis/runner_loadingpackage.go:80 +0xb4
created by github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze
	/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.2-0.20221211114606-b2462ed75201/pkg/golinters/goanalysis/runner_loadingpackage.go:75 +0x1eb 
WARN [runner] Can't run linter goanalysis_metalinter: goanalysis_metalinter: buildir: package "netip" (isInitialPkg: false, needAnalyzeSource: true): in net/netip.AddrFromSlice: cannot convert Load <[]byte> t0 ([]byte) to [4]byte 
ERRO Running error: 1 error occurred:
	* can't run linter goanalysis_metalinter: goanalysis_metalinter: buildir: package "netip" (isInitialPkg: false, needAnalyzeSource: true): in net/netip.AddrFromSlice: cannot convert Load <[]byte> t0 ([]byte) to [4]byte

@atc0005
Copy link
Owner Author

atc0005 commented Dec 12, 2022

Opened an upstream discussion:

@atc0005
Copy link
Owner Author

atc0005 commented Jan 11, 2023

As of ldez/golangci-lint@1af8a00 (and likely earlier commits), golangci-lint builds/runs within a Go 1.20rc2 Docker image.

I'm going to update the unstable image to use that version of golangci-lint for now.

@atc0005 atc0005 changed the title golangci-lint v1.50.1 unusable within Go 1.20rc1 image golangci-lint v1.50.1 unusable within Go 1.20 pre-release images Jan 11, 2023
atc0005 added a commit that referenced this issue Jan 11, 2023
Use dev feat/go1.20 branch from golangci-lint fork until
official support lands in official repo.

refs GH-789
@atc0005 atc0005 changed the title golangci-lint v1.50.1 unusable within Go 1.20 pre-release images golangci-lint unusable within Go 1.20 pre-release images Jan 11, 2023
atc0005 added a commit that referenced this issue Jan 11, 2023
- v1.50.1 for stable, oldstable images
- feat/go1.20 dev branch for unstable image

refs GH-789
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant