Golangci-lint: pre-release for Go 1.14

Created on 6 Feb 2020  路  15Comments  路  Source: golangci/golangci-lint

Hello,
Is it possible to have a pre-release (maybe a beta) for Go 1.14 ?
It seems that the pre-compiled binaries are not compatible with Go 1.14rc1.

Most helpful comment

All 15 comments

Hey, I'm planning an alpha release compiled with go1.14rc1 until Friday.

golangci-lint-SNAPSHOT-536a4f0e1234d8329d11cdd3c375a469fa920802-darwin-386.tar.gz
golangci-lint-SNAPSHOT-536a4f0e1234d8329d11cdd3c375a469fa920802-darwin-amd64.tar.gz
golangci-lint-SNAPSHOT-536a4f0e1234d8329d11cdd3c375a469fa920802-freebsd-386.tar.gz
golangci-lint-SNAPSHOT-536a4f0e1234d8329d11cdd3c375a469fa920802-freebsd-amd64.tar.gz
golangci-lint-SNAPSHOT-536a4f0e1234d8329d11cdd3c375a469fa920802-freebsd-armv6.tar.gz
golangci-lint-SNAPSHOT-536a4f0e1234d8329d11cdd3c375a469fa920802-freebsd-armv7.tar.gz
golangci-lint-SNAPSHOT-536a4f0e1234d8329d11cdd3c375a469fa920802-linux-386.tar.gz
golangci-lint-SNAPSHOT-536a4f0e1234d8329d11cdd3c375a469fa920802-linux-amd64.tar.gz
golangci-lint-SNAPSHOT-536a4f0e1234d8329d11cdd3c375a469fa920802-linux-arm64.tar.gz
golangci-lint-SNAPSHOT-536a4f0e1234d8329d11cdd3c375a469fa920802-linux-armv6.tar.gz
golangci-lint-SNAPSHOT-536a4f0e1234d8329d11cdd3c375a469fa920802-linux-mips64.tar.gz
golangci-lint-SNAPSHOT-536a4f0e1234d8329d11cdd3c375a469fa920802-linux-mips64le.tar.gz
golangci-lint-SNAPSHOT-536a4f0e1234d8329d11cdd3c375a469fa920802-linux-ppc64le.tar.gz
golangci-lint-SNAPSHOT-536a4f0e1234d8329d11cdd3c375a469fa920802-linux-s390x.tar.gz
golangci-lint-SNAPSHOT-536a4f0e1234d8329d11cdd3c375a469fa920802-windows-386.zip
golangci-lint-SNAPSHOT-536a4f0e1234d8329d11cdd3c375a469fa920802-windows-amd64.zip
golangci-lint-SNAPSHOT-536a4f0e1234d8329d11cdd3c375a469fa920802-linux-armv7.tar.gz

Seems it is non-trivial to do it in automated way via our CI/CD so I've did it manually.

@ernado, @pierrre I've updated the .travis.yml to build against Go 1.14rc1 in #964. However, https://github.com/golangci/golangci-lint/blob/master/.travis.yml#L34 needs to be updated to to 1.14+ before new a release will be built that supports the version. @pierrre Have you tried installing via go get now that #930 has been merged?

Thank you, but I have another very strange error:

ERRO Running error: failed to pre-run govet: failed to configure analyzers: settings key "printf" must be valid analyzer name, valid analyzers: [asmdecl assign atomic atomicalign bools buildtag cgocall composites copylocks deepequalerrors errorsas findcall httpresponse loopclosure lostcancel nilfunc nilness shadow shift sortslice stdmethods structtag tests unmarshal unreachable unsafeptr unusedresult]

My config:

run:
  timeout: "10m"
linters:
  disable-all: true
  enable:
    - "bodyclose"
    - "deadcode"
    - "depguard"
    - "errcheck"
    - "gocritic"
    - "gocyclo"
    - "gofmt"
    - "goimports"
    - "golint"
    - "govet"
    - "ineffassign"
    - "megacheck"
    - "misspell"
    - "nakedret"
    - "structcheck"
    - "unconvert"
    - "unparam"
    - "varcheck"
linters-settings:
  depguard:
    list-type: blacklist
    include-go-root: true
    packages:
      - errors
      - reflect
      - unsafe
      - github.com/pkg/errors
  gocyclo:
    min-complexity: 10
  govet:
    enable-all: true
    settings:
      printf:
        funcs:
          - "(github.com/xxx/golang-libraries/errors).Newf"
          - "(github.com/xxx/golang-libraries/errors).WithMessagef"
          - "(github.com/xxx/golang-libraries/errors).Wrapf"
issues:
  exclude-use-default: false
  max-issues-per-linter: 0
  max-same-issues: 0

I think I've already mentioned this issue somewhere.
It's due to a recent change in x/tools (the config of the govet linter)

EDIT: sorry, I never reported this issue actually, it was on the internal slack of my company

@pierrre what version is causing that error?

v1.23.3 installed with go get
cd /tmp && GO111MODULE=on GOBIN=/home/pierre/go/pkg/golangci-lint/v1.23.3-mod go get -v github.com/golangci/golangci-lint/cmd/[email protected]

But I'm dumb: I understand now that #930 has not yet been released in a tag, correct ?

Oh, I forgot to mention that, sorry :(
You can try version from my comment or build it by yourself with goreleaser --snapshot command in project root.

I've also issued v1.23.4 that will be available in ~20min.

Meh, due to some issues with CI/CD the v1.23.6 is valid latest version.

The install with go get and v1.23.6 works perfectly fine for me now !
Thank you very much!

Do you plan to make this installation method supported again ?

The go get method should work until we have any critical replace directives and go tools are not updating in backwards incompatible manner (e.g. last our bug with x/tools).

Personally I will try to fix any go-get related bugs, so it is kinda supported, but binary releases are still recommended.

OK.

I will close this issue now, because my problem is fixed: I can use golangci-lint with Go 1.14rc1.

FYI, I'm using this command to install it:

cd /tmp && GO111MODULE=on GOBIN=/home/pierre/go/pkg/golangci-lint/v1.23.6-mod go get -v github.com/golangci/golangci-lint/cmd/[email protected]

It's very strange:

  • my local Go version is 1.14rc1
  • I'm running golangci-lint v1.23.6 from the pre-compiled binaries you provide
  • it works without any error

So, it seems I don't need to use go get :thinking:
The v1.23.6 compiled with Go 1.13 works with my local Go 1.14rc1
Am I misunderstanding something ?

Seems like there is no hard requirement to use go1.14 to support go1.14, that works for me too 馃憖

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jsm picture jsm  路  5Comments

DarthHater picture DarthHater  路  4Comments

bacongobbler picture bacongobbler  路  4Comments

rhcarvalho picture rhcarvalho  路  4Comments

nektro picture nektro  路  3Comments