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='/root/.cache/go-build'
GOENV='/root/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/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/linux_amd64'
GOVCS=''
GOVERSION='go1.21.5'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/dev/null'
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-build1994747404=/tmp/go-build -gno-record-gcc-switches'
What did you do?
Used the latest go version available i.e., go1.21.5 linux/amd64
What did you expect to see?
No linting errors.
What did you see instead?
Got the linting error in go package files EX:../../usr/local/go/src/net/http/internal/chunked.go:79:14: undefined: max (typecheck) cr.excess = max(cr.excess, 0) ^ ../../usr/local/go/src/net/http/internal/chunked.go:79:14: undefined: max (typecheck) cr.excess = max(cr.excess, 0) ^ ../../usr/local/go/src/net/http/internal/chunked.go:79:14: undefined: max (typecheck) cr.excess = max(cr.excess, 0)
Comment From: fzipp
max
is a valid function in Go 1.21. Your linter likely needs an update.
Comment From: seankhliao
that's a problem of your linter
Comment From: tssushma
max
is a valid function in Go 1.21. Your linter likely needs an update.
Ok thank you will update the linters version
Comment From: henri9813
Hello,
Why not, but why the linter go out of his scope ?