6

I upgraded the version of go to go1.18.3, following the instruction on https://go.dev/doc/install:

rm -rf /usr/local/go && tar -C /usr/local -xzf go1.18.3.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin

Then I tried to run a Makefile for my go project but was prompted that golangci-lint was not installed. I assume that this was due to rm -rf /usr/local/go and all the packages were removed, or I somehow messed up with the files during the upgrade. I went on to install golangci-lint:

go install github.com/golangci/golangci-lint/cmd/[email protected]

A lot of previously unseen errors were reported. Like

could not import math/bits (-: could not load export data: cannot import "math/bits" (unknown iexport format version 2), export data is newer version - update tool)'

undeclared name: `yaml

...

I'm quite confused because the project used to compile successfully after lint checks. Should I downgrade gplangci-lint?

1 Answer 1

0

go install Will install golangci-lint into your go/bin path. And that is previous where it lived and you are correct that rm -rf /usr/local/go would have remove it.

As for the newly reported errors, every update of golangci-lint will bring in more rules and linters. You can either downgrade, fix the errors or configure golangci-lint to your preferences https://golangci-lint.run/usage/configuration/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.