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

Bug Report: go vet fails on vitess.io/vitess v0.17.0+ #13850

Open
mbrancato opened this issue Aug 25, 2023 · 3 comments
Open

Bug Report: go vet fails on vitess.io/vitess v0.17.0+ #13850

mbrancato opened this issue Aug 25, 2023 · 3 comments

Comments

@mbrancato
Copy link

Overview of the Issue

Using go vet, the vitess library fails.
https://pkg.go.dev/cmd/vet

# vitess.io/vitess/go/mysql/json
/Users/mike/go/pkg/mod/vitess.io/vitess@v0.17.2/go/mysql/json/parser.go:588:31: type func(a kv, b kv) bool of func(a, b kv) bool {…} does not match inferred type func(a kv, b kv) int for func(a E, b E) int

I'm using Go 1.20.x. Version 0.16.x passes just fine.

Reproduction Steps

  • Add vitess.io/vitess v0.17.2 to go.mod
  • Run go get
  • Run go vet

Binary Version

0.17.0+

Operating System and Environment details

MacOS

Log Fragments

No response

@mbrancato mbrancato added Needs Triage This issue needs to be correctly labelled and triaged Type: Bug labels Aug 25, 2023
@ajm188
Copy link
Contributor

ajm188 commented Aug 25, 2023

i cannot reproduce this:

➜  vitess git:(vmain) ✗ go vet ./go/mysql/...
➜  vitess git:(vmain) ✗ go version
go version go1.20.5 darwin/arm64
➜  vitess git:(vmain) ✗ git switch --detach upstream/release-17.0
HEAD is now at 0c0377d2c1 [release-17.0] Flakes: empty vtdataroot before starting a new vreplication e2e test (#13803) (#13822)
➜  vitess git:(0c0377d2c1) ✗ go vet ./go/mysql/...
➜  vitess git:(0c0377d2c1) ✗ git switch --detach v17.0.2 
HEAD is now at 96ac0a691d Release of v17.0.2 (#13809)
➜  vitess git:(96ac0a691d) ✗ go vet ./go/mysql/...      
➜  vitess git:(96ac0a691d) ✗ 

I found effc60e which changed the signature of the function in question, and checking out its parent doesn't reproduce either:

➜  vitess git:(vmain) ✗ git checkout 13d1aad
Note: switching to '13d1aad'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 13d1aad566 Per workload TxThrottler metrics (#13526)
➜  vitess git:(13d1aad566) ✗ go vet ./go/mysql/...
➜  vitess git:(13d1aad566) ✗

@shlomi-noach shlomi-noach added Component: Build/CI and removed Needs Triage This issue needs to be correctly labelled and triaged labels Aug 31, 2023
@tinmrn
Copy link

tinmrn commented Sep 18, 2023

Looks like it's because of golang.org/x/exp

Script to reproduce: https://gist.github.com/tinmrn/4b00ea3345450492eece64e7e4d96726

+ go version
go version go1.21.1 linux/amd64

...

+ go vet ./...
# vitess.io/vitess/go/mysql/json
/home/bas/go/pkg/mod/vitess.io/vitess@v0.17.2/go/mysql/json/parser.go:588:31: type func(a kv, b kv) bool of func(a, b kv) bool {…} does not match inferred type func(a kv, b kv) int for func(a E, b E) int

@alextanhongpin
Copy link

I'm facing this issue too. The solution was to downgrade golang.org/x/exp:

$ go get golang.org/x/exp@v0.0.0-20230905200255-921286631fa9

That version above is taken from https://pkg.go.dev/golang.org/x/exp?tab=versions and seems to be working.

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

No branches or pull requests

6 participants