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

Update go mod to indicate usage of go 1.19+ #157

Open
VamshikShetty opened this issue Jun 2, 2023 · 0 comments
Open

Update go mod to indicate usage of go 1.19+ #157

VamshikShetty opened this issue Jun 2, 2023 · 0 comments

Comments

@VamshikShetty
Copy link

VM operator’s go mod indicates it leveraging go 1.18 but when running make lint-go-full I’m facing an error that indicates few dependencies versions are suitable for go 1.19

Steps to duplicate the issue :

  1. Start a container with go 1.18 alpine :
docker run --name test-18 -it golang:1.18.0-alpine
  1. Inside the docker run following cmds :
apk update
apk add --no-cache bash git make build-base

git clone https://github.com/vmware-tanzu/vm-operator.git
cd vm-operator

make lint-go-full

Output :

make -C hack/tools golangci-lint
make[1]: Entering directory '/go/vm-operator/hack/tools'
go build -tags=vmop_tools -o bin/golangci-lint github.com/golangci/golangci-lint/cmd/golangci-lint
go: downloading github.com/golangci/golangci-lint v1.51.2
go: downloading github.com/fatih/color v1.14.1
go: downloading github.com/gofrs/flock v0.8.1
.
.
.
go: downloading github.com/pelletier/go-toml v1.9.5
go: downloading github.com/mattn/go-runewidth v0.0.9
# honnef.co/go/tools/unused
/go/pkg/mod/honnef.co/go/[email protected]/unused/unused.go:419:14: obj.Origin undefined (type *types.Var has no field or method Origin)
/go/pkg/mod/honnef.co/go/[email protected]/unused/unused.go:421:14: obj.Origin undefined (type *types.Func has no field or method Origin)
note: module requires Go 1.19
# honnef.co/go/tools/staticcheck
/go/pkg/mod/honnef.co/go/[email protected]/staticcheck/lint.go:4025:29: righti.Method(i).Origin undefined (type *types.Func has no field or method Origin)
/go/pkg/mod/honnef.co/go/[email protected]/staticcheck/lint.go:4030:36: sel.Obj().(*types.Func).Origin undefined (type *types.Func has no field or method Origin)
note: module requires Go 1.19
make[1]: *** [Makefile:78: bin/golangci-lint] Error 2
make[1]: Leaving directory '/go/vm-operator/hack/tools'
make: *** [Makefile:181: hack/tools/bin/golangci-lint] Error 2

It passed for golang:1.20.0-alpine & golang:1.19.0-alpine

Go mod needs to be edited to indicate that we need to run go 1.19 or at-least those dependencies needs to be downgraded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant