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

go 1.21.5 breaks golangci-lint, works with go 1.21.4 #64592

Closed
nicks opened this issue Dec 6, 2023 · 2 comments
Closed

go 1.21.5 breaks golangci-lint, works with go 1.21.4 #64592

nicks opened this issue Dec 6, 2023 · 2 comments

Comments

@nicks
Copy link

nicks commented Dec 6, 2023

Go version

go version go1.21.5 linux/amd64

What operating system and processor architecture are you using (go env)?

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/nick/.cache/go-build'
GOENV='/home/nick/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/nick/.gvm/pkgsets/go1.21.5/global/pkg/mod'
GONOPROXY='github.com/docker'
GONOSUMDB='github.com/docker'
GOOS='linux'
GOPATH='/home/nick/.gvm/pkgsets/go1.21.5/global'
GOPRIVATE='github.com/docker'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/home/nick/.gvm/gos/go1.21.5'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/nick/.gvm/gos/go1.21.5/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.5'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/home/nick/src/scratch/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 -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build267141797=/tmp/go-build -gno-record-gcc-switches'

What did you do?

Repro steps:

  1. Download golangci-lint v1.52.2 (https://github.com/golangci/golangci-lint/releases/tag/v1.52.2)
  2. Install go v1.21.5
  3. Use the following main.go
package main

import (
	"github.com/segmentio/analytics-go/v3"
)

func main() {
	var x analytics.Client
	_ = x
}
  1. ~/Downloads/golangci-lint-1.52.2-linux-amd64/golangci-lint run .

What did you expect to see?

golangci-lint to pass

What did you see instead?

golangci-lint fails with this error:

~/Downloads/golangci-lint-1.52.2-linux-amd64/golangci-lint run .
main.go:1: : # github.com/nicks/scratch
./main.go:8:6: invalid composite literal type analytics.Client (typecheck)
package main
../../../linuxbrew/.linuxbrew/Cellar/go/1.21.5/libexec/src/net/http/internal/chunked.go:79:14: undefined: max (typecheck)
	cr.excess = max(cr.excess, 0)

Looks like this was broken by 285ef16, which added the new max syntax

Rolling back to go 1.21.4 fixes the problem.

@mauri870
Copy link
Member

mauri870 commented Dec 7, 2023

This seems to be a golanci-lint issue.

See golangci/golangci-lint#3718

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Dec 7, 2023
@kvmw
Copy link

kvmw commented Dec 7, 2023

Having the exact same issue after upgrading to 1.21.5. rolling back to 1.21.4 or earlier version fixes the problem.

mmcloughlin added a commit to mmcloughlin/avo that referenced this issue Jan 7, 2024

Verified

This commit was signed with the committer’s verified signature.
myitcv Paul Jolly
Upgrade `golangci-lint` to address a bug triggered since Go 1.21.5.

See: golangci/golangci-lint#3718
See: golang/go#64592
mmcloughlin added a commit to mmcloughlin/addchain that referenced this issue Jan 8, 2024

Verified

This commit was signed with the committer’s verified signature.
myitcv Paul Jolly
Upgrade `golangci-lint` to address a bug triggered since Go 1.21.5.

See: golangci/golangci-lint#3718
See: golang/go#64592
mmcloughlin added a commit to mmcloughlin/md4 that referenced this issue Jan 8, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Upgrade `golangci-lint` to address a bug triggered since Go 1.21.5.

See: golangci/golangci-lint#3718
See: golang/go#64592
mmcloughlin added a commit to mmcloughlin/bib that referenced this issue Jan 8, 2024
Upgrade `golangci-lint` to address a bug triggered since Go 1.21.5.

See: golangci/golangci-lint#3718
See: golang/go#64592
@golang golang locked and limited conversation to collaborators Dec 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants