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

Support for golang 1.21? Golangc-lint 1.53.3 errors out when using the new slices package #3932

Closed
4 tasks done
vamshiaruru32 opened this issue Jun 29, 2023 · 2 comments
Closed
4 tasks done
Labels
question Further information is requested

Comments

@vamshiaruru32
Copy link

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 (e.g., gocritic, go vet, etc.). (https://golangci-lint.run/usage/linters/)

Description of the problem

Hi everyone, apologies if this is already planned and I haven't seen the discussion, but I'd like to use the new go release candidate (1.21rc2). When I run golanngc-lint, I get the following error

golangci-lint run --fix -E exhaustruct,gci,makezero,govet
../../../../usr/local/go/src/slices/sort.go:67:7: undefined: min (typecheck)
                m = min(m, x[i])
                    ^
../../../../usr/local/go/src/slices/sort.go:96:7: undefined: max (typecheck)
                m = max(m, x[i])
                    ^
error: Recipe `lint` failed on line 27 with exit code 1

I have read from other discussions that typecheck can't be disabled. So is there a way to get around this? Or are there plans for support for 1.21 while it is still in RC state?

Thanks, any help is appreciated.

Version of golangci-lint

$ golangci-lint --version
# Paste output here

Configuration file

$ cat .golangci.yml
golangci-lint has version 1.53.3 built with go1.20.5 from 2dcd82f3 on 2023-06-15T10:50:11Z

Go environment

$ go version && go env
go version go1.21rc2 linux/amd64
GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/vamshi/.cache/go-build'
GOENV='/home/vamshi/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/vamshi/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/vamshi/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.21rc2'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/home/vamshi/tectonic/bastille/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-build4245480262=/tmp/go-build -gno-record-gcc-switches'

Verbose output of running

$ golangci-lint cache clean
$ golangci-lint run -v
INFO [config_reader] Config search paths: [./ /home/vamshi/tectonic/bastille /home/vamshi/tectonic /home/vamshi /home /] 
INFO [lintersdb] Active 10 linters: [errcheck exhaustruct gci gosimple govet ineffassign makezero staticcheck typecheck unused] 
INFO [loader] Go packages loading at mode 575 (exports_file|files|compiled_files|deps|imports|name|types_sizes) took 122.25624ms 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 4.152105ms 
INFO [linters_context/goanalysis] analyzers took 44.531110335s with top 10 stages: buildir: 18.254845079s, ctrlflow: 4.736373425s, printf: 4.509534647s, fact_deprecated: 4.49068076s, nilness: 3.080488658s, fact_purity: 2.905147169s, typedness: 2.875656869s, SA5012: 2.860470075s, inspect: 715.978788ms, gci: 9.103375ms 
INFO [runner] fixer took 0s with no stages        
INFO [runner] Issues before processing: 1122, after processing: 2 
INFO [runner] Processors filtering stat (out/in): identifier_marker: 1122/1122, diff: 2/2, max_same_issues: 2/2, max_from_linter: 2/2, path_prefixer: 2/2, skip_files: 1122/1122, autogenerated_exclude: 1122/1122, nolint: 1114/1122, path_shortener: 2/2, fixer: 2/2, cgo: 1122/1122, skip_dirs: 1122/1122, exclude: 1122/1122, exclude-rules: 1122/1122, uniq_by_line: 2/1114, filename_unadjuster: 1122/1122, path_prettifier: 1122/1122, max_per_file_from_linter: 2/2, source_code: 2/2, severity-rules: 2/2, sort_results: 2/2 
INFO [runner] processing took 11.590057ms with stages: identifier_marker: 6.907811ms, nolint: 1.671364ms, exclude-rules: 1.234271ms, path_prettifier: 999.654µs, skip_dirs: 315.345µs, autogenerated_exclude: 160.983µs, cgo: 103.995µs, filename_unadjuster: 93.335µs, uniq_by_line: 42.326µs, source_code: 32.437µs, fixer: 21.937µs, max_same_issues: 2.599µs, path_shortener: 928ns, max_from_linter: 879ns, max_per_file_from_linter: 586ns, skip_files: 417ns, exclude: 332ns, diff: 268ns, sort_results: 240ns, severity-rules: 220ns, path_prefixer: 130ns 
INFO [runner] linters took 4.060630214s with stages: goanalysis_metalinter: 4.048960638s 
../../../../usr/local/go/src/slices/sort.go:67:7: undefined: min (typecheck)
                m = min(m, x[i])
                    ^
../../../../usr/local/go/src/slices/sort.go:96:7: undefined: max (typecheck)
                m = max(m, x[i])
                    ^
INFO File cache stats: 1 entries of total size 5.5KiB 
INFO Memory: 43 samples, avg is 378.9MB, max is 614.6MB 
INFO Execution took 4.190781466s  

Code example or link to a public repository

// add your code here
package main

import (
	"slices"
)

func main() {
	a := []int{1, 2, 3, 4, 5}
	slices.Clone(a)
}
@vamshiaruru32 vamshiaruru32 added the bug Something isn't working label Jun 29, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Jun 29, 2023

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 Jun 29, 2023

Hello,

https://golangci-lint.run/usage/faq/#which-go-versions-are-supported

You can follow #3922.

@ldez ldez closed this as completed Jun 29, 2023
@ldez ldez added question Further information is requested and removed bug Something isn't working labels Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants