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/golangci-lint@v1.46.2
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?