Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

golangci-lint unusable within Go 1.23 pre-release images #1590

Closed
atc0005 opened this issue Jun 26, 2024 · 0 comments · Fixed by #1591
Closed

golangci-lint unusable within Go 1.23 pre-release images #1590

atc0005 opened this issue Jun 26, 2024 · 0 comments · Fixed by #1591
Assignees
Labels
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Jun 26, 2024

Overview

As when Go 1.20 support was under development (see GH-789), the latest stable version of golangci-lint does not support the upcoming Go 1.23rc1 pre-release image.

Log output from a recent CI run:

golangci-lint has version 1.59.1 built with go1.22.3 from 1a55854a on 2024-06-09T18:08:33Z
internal/certs/validation-results.go:69:17: undefined: nagios (typecheck)
	ServiceState() nagios.ServiceState
	               ^
internal/certs/certs.go:255:38: undefined: nagios (typecheck)
func ServiceState(val ServiceStater) nagios.ServiceState {
                                     ^
internal/certs/validation-expiration.go:382:54: undefined: nagios (typecheck)
func (evr ExpirationValidationResult) ServiceState() nagios.ServiceState {
                                                     ^
../../../usr/local/go/src/slices/iter.go:51:17: cannot range over seq (variable of type iter.Seq[E]) (typecheck)
	for v := range seq {
	               ^
../../../usr/local/go/src/os/stat_linux.go:47:57: not enough arguments in call to time.Unix
	have (unknown type)
	want (int64, int64) (typecheck)
	return time.Unix(fi.Sys().(*syscall.Stat_t).Atim.Unix())
	                                                       ^
../../../usr/local/go/src/math/big/intconv.go:220:21: r.ReadRune undefined (type byteReader has no field or method ReadRune) (typecheck)
	ch, size, err := r.ReadRune()
	                   ^
../../../usr/local/go/src/math/big/intconv.go:228:11: r.UnreadRune undefined (type byteReader has no field or method UnreadRune) (typecheck)
	return r.UnreadRune()
	         ^
../../../usr/local/go/src/crypto/x509/pkcs8.go:105:7: previous case (typecheck)
	case *rsa.PrivateKey:
	     ^
../../../usr/local/go/src/crypto/x509/x509.go:86:7: previous case (typecheck)
	case *rsa.PublicKey:
	     ^
../../../usr/local/go/src/crypto/x509/x509.go:932:7: previous case (typecheck)
	case *rsa.PublicKey:
	     ^
../../../usr/local/go/src/regexp/exec.go:432:48: inst.Arg undefined (type *onePassInst has no field or method Arg) (typecheck)
	if pos == 0 && flag.match(syntax.EmptyOp(inst.Arg)) &&
	                                              ^
../../../usr/local/go/src/regexp/exec.go:446:17: inst.Out undefined (type *onePassInst has no field or method Out) (typecheck)
		pc = int(inst.Out)
		              ^
../../../usr/local/go/src/regexp/exec.go:447:15: inst.Op undefined (type *onePassInst has no field or method Op) (typecheck)
		switch inst.Op {
		            ^
../../../usr/local/go/src/regexp/exec.go:458:13: inst.MatchRune undefined (type *onePassInst has no field or method MatchRune) (typecheck)
			if !inst.MatchRune(r) {
			         ^
../../../usr/local/go/src/regexp/exec.go:462:17: inst.Rune undefined (type *onePassInst has no field or method Rune) (typecheck)
			if r != inst.Rune[0] {
			             ^
../../../usr/local/go/src/regexp/exec.go:480:39: inst.Arg undefined (type *onePassInst has no field or method Arg) (typecheck)
			if !flag.match(syntax.EmptyOp(inst.Arg)) {
			                                   ^
../../../usr/local/go/src/regexp/exec.go:485:16: inst.Arg undefined (type *onePassInst has no field or method Arg) (typecheck)
			if int(inst.Arg) < len(m.matchcap) {
			            ^
../../../usr/local/go/src/regexp/onepass.go:76:12: i.MatchRunePos undefined (type *onePassInst has no field or method MatchRunePos) (typecheck)
	next := i.MatchRunePos(r)
	          ^
../../../usr/local/go/src/regexp/onepass.go:80:7: i.Op undefined (type *onePassInst has no field or method Op) (typecheck)
	if i.Op == syntax.InstAltMatch {
	     ^
../../../usr/local/go/src/regexp/onepass.go:81:12: i.Out undefined (type *onePassInst has no field or method Out) (typecheck)
		return i.Out
		         ^
../../../usr/local/go/src/regexp/onepass.go:238:21: p.Inst[pc].Op undefined (type onePassInst has no field or method Op) (typecheck)
		switch p.Inst[pc].Op {
		                  ^
../../../usr/local/go/src/regexp/onepass.go:243:29: p.Inst[pc].Out undefined (type onePassInst has no field or method Out) (typecheck)
			p_A_Other := &p.Inst[pc].Out
			                         ^
../../../usr/local/go/src/regexp/onepass.go:244:27: p.Inst[pc].Arg undefined (type onePassInst has no field or method Arg) (typecheck)
			p_A_Alt := &p.Inst[pc].Arg
			                       ^
../../../usr/local/go/src/regexp/onepass.go:247:17: instAlt.Op undefined (type onePassInst has no field or method Op) (typecheck)
			if !(instAlt.Op == syntax.InstAlt || instAlt.Op == syntax.InstAltMatch) {
			             ^
../../../usr/local/go/src/regexp/onepass.go:250:18: instAlt.Op undefined (type onePassInst has no field or method Op) (typecheck)
				if !(instAlt.Op == syntax.InstAlt || instAlt.Op == syntax.InstAltMatch) {
				             ^
../../../usr/local/go/src/regexp/onepass.go:256:17: instOther.Op undefined (type onePassInst has no field or method Op) (typecheck)
			if instOther.Op == syntax.InstAlt || instOther.Op == syntax.InstAltMatch {
			             ^
../../../usr/local/go/src/regexp/onepass.go:262:33: p.Inst[*p_A_Alt].Out undefined (type onePassInst has no field or method Out) (typecheck)
			p_B_Alt := &p.Inst[*p_A_Alt].Out
			                             ^
../../../usr/local/go/src/regexp/onepass.go:263:35: p.Inst[*p_A_Alt].Arg undefined (type onePassInst has no field or method Arg) (typecheck)
			p_B_Other := &p.Inst[*p_A_Alt].Arg
			                               ^
../../../usr/local/go/src/regexp/onepass.go:265:15: instAlt.Out undefined (type onePassInst has no field or method Out) (typecheck)
			if instAlt.Out == uint32(pc) {
			           ^
../../../usr/local/go/src/regexp/onepass.go:267:22: instAlt.Arg undefined (type onePassInst has no field or method Arg) (typecheck)
			} else if instAlt.Arg == uint32(pc) {
			                  ^
../../../usr/local/go/src/regexp/onepass.go:315:15: inst.Op undefined (type *onePassInst has no field or method Op) (typecheck)
		switch inst.Op {
		            ^
../../../usr/local/go/src/regexp/onepass.go:317:20: inst.Out undefined (type *onePassInst has no field or method Out) (typecheck)
			ok = check(inst.Out, m) && check(inst.Arg, m)
			                ^
../../../usr/local/go/src/regexp/onepass.go:319:23: inst.Out undefined (type *onePassInst has no field or method Out) (typecheck)
			matchOut := m[inst.Out]
			                   ^
../../../usr/local/go/src/regexp/onepass.go:332:10: inst.Op undefined (type *onePassInst has no field or method Op) (typecheck)
				inst.Op = syntax.InstAltMatch
				     ^
../../../usr/local/go/src/regexp/onepass.go:367:16: inst.Rune undefined (type *onePassInst has no field or method Rune) (typecheck)
			if len(inst.Rune) == 0 {
			            ^
../../../usr/local/go/src/regexp/onepass.go:373:16: inst.Rune undefined (type *onePassInst has no field or method Rune) (typecheck)
			if len(inst.Rune) == 1 && syntax.Flags(inst.Arg)&syntax.FoldCase != 0 {
			            ^
../../../usr/local/go/src/regexp/onepass.go:449:14: p.Inst[i].Rune undefined (type onePassInst has no field or method Rune) (typecheck)
			p.Inst[i].Rune = onePassRunes[i]
			          ^
../../../usr/local/go/src/crypto/tls/tls.go:15:2: "bytes" imported and not used (typecheck)
	"bytes"
	^

The golangci-lint project is working to add complete Go 1.23 support. Until then, what support is available can be found in the ldez:feat/go1.23 branch.

References

@atc0005 atc0005 added this to the Next Release milestone Jun 26, 2024
@atc0005 atc0005 self-assigned this Jun 26, 2024
atc0005 added a commit that referenced this issue Jun 26, 2024
Use dev feat/go1.23 branch from golangci-lint fork in unstable
linting image until complete support lands in official repo.

refs GH-1590
atc0005 added a commit that referenced this issue Jun 26, 2024
- v1.59.1 for stable, oldstable images
- feat/go1.23 dev branch for unstable image

Other minor formatting/language tweaks for linter tables.

refs GH-1590
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant