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

GCI chokes on math/rand/v2 #4415

Closed
5 tasks done
andig opened this issue Feb 25, 2024 · 5 comments
Closed
5 tasks done

GCI chokes on math/rand/v2 #4415

andig opened this issue Feb 25, 2024 · 5 comments
Labels
bug Something isn't working dependencies Relates to an upstream dependency

Comments

@andig
Copy link

andig commented Feb 25, 2024

Welcome

Description of the problem

Importing math/rand/v2, GCI wants the import in the second, no-standard-library, import block which is wrong:

  Running [/home/runner/golangci-lint-1.56.2-linux-amd64/golangci-lint run --out-format=colored-line-number,github-actions --timeout 5m] in [] ...
  provider/mqtt/client.go:6: File is not `gci`-ed with --skip-generated -s standard -s default (gci)
  	"math/rand/v2"
  provider/mqtt/client.go:15: File is not `gci`-ed with --skip-generated -s standard -s default (gci)
  	"github.com/evcc-io/evcc/util/request"
  hems/ocpp/ocpp.go:5: File is not `gci`-ed with --skip-generated -s standard -s default (gci)
  	"math/rand/v2"
  Error: File is not `gci`-ed with --skip-generated -s standard -s default (gci)
  Error: File is not `gci`-ed with --skip-generated -s standard -s default (gci)
  Error: File is not `gci`-ed with --skip-generated -s standard -s default (gci)

Running with --fix produces imports like:

	"fmt"
	"strings"
	"time"

	"github.com/evcc-io/evcc/api"
	"github.com/evcc-io/evcc/core/site"
	"github.com/evcc-io/evcc/hems/ocpp/profile"
	"github.com/evcc-io/evcc/util"
	"github.com/evcc-io/evcc/util/machine"
	ocpp16 "github.com/lorenzodonini/ocpp-go/ocpp1.6"
	ocppcore "github.com/lorenzodonini/ocpp-go/ocpp1.6/core"
	"github.com/lorenzodonini/ocpp-go/ws"
	"math/rand/v2" // <-- doesn't belong there

Reproed locally, so not depending on action.

Version of golangci-lint

$ golangci-lint --version
golangci-lint has version 1.56.2 built with go1.22.0 from 58a724a on 2024-02-15T12:52:06Z

Configuration

.

Go environment

$ go version && go env
go version go1.22.0 darwin/arm64
GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/andig/Library/Caches/go-build'
GOENV='/Users/andig/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/andig/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/andig/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/homebrew/Cellar/go/1.22.0/libexec'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/homebrew/Cellar/go/1.22.0/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.22.0'
GCCGO='gccgo'
AR='ar'
CC='cc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='/Users/andig/htdocs/evcc/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 -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/sv/rs_453y57xj86xsbz3kw1mbc0000gn/T/go-build1340198295=/tmp/go-build -gno-record-gcc-switches -fno-common'

Verbose output of running

$ golangci-lint cache clean
$ golangci-lint run -v
# paste output here

A minimal reproducible example or link to a public repository

evcc-io/evcc@ad0c6d5

Validation

  • Yes, I've included all information above (version, config, etc.).
@andig andig added the bug Something isn't working label Feb 25, 2024
andig added a commit to evcc-io/evcc that referenced this issue Feb 25, 2024
@andig

This comment was marked as resolved.

@andig
Copy link
Author

andig commented Feb 25, 2024

Note: this is fixed in daixiang0/gci#186

@ldez ldez added the dependencies Relates to an upstream dependency label Feb 25, 2024
@ldez
Copy link
Member

ldez commented Feb 25, 2024

Fixed by #4400

@ldez ldez closed this as completed Feb 25, 2024
@andig
Copy link
Author

andig commented Feb 26, 2024

Thank you very much.

@fatedier
Copy link

fatedier commented Mar 5, 2024

Need a new release for this.

thierolm pushed a commit to thierolm/evcc that referenced this issue Mar 10, 2024
thierolm pushed a commit to thierolm/evcc that referenced this issue Mar 19, 2024
naltatis pushed a commit to evcc-io/evcc that referenced this issue Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Relates to an upstream dependency
Projects
None yet
Development

No branches or pull requests

3 participants