sqlvet icon indicating copy to clipboard operation
sqlvet copied to clipboard

Upgrade to Go 1.18 and upgrade golang.org/x/tools package

Open meetwithabhishek opened this issue 1 year ago • 0 comments

Upgrade Go version to 1.18 and upgrade golang.org/x/tools package.

This is needed as sqlvet gave errors while vetting the Go 1.18 generics code. Upgrading the golang.org/x/tools fixes the error.
Below is the error I'm facing -

➪ ./sqlvet -v .
[!] No schema specified, will run without table and column validation.
DEBU[0014] Loaded 5 packages: [private.repo.local/masked.git/config private.repo.local/masked.git/models private.repo.local/masked.git/controller private.repo.local/masked.git/httptransport private.repo.local/masked.git/cmd/masked] 
DEBU[0014] Identified 0 queries to ignore               
DEBU[0014] Loaded 7 matchers, checking imported SQL packages... 
DEBU[0014] 	github.com/jinzhu/gorm imported             
DEBU[0014] 	private.repo.local/sigo.git/v9/sigodb imported 
DEBU[0014] Performaing whole-program analysis...        
panic: T

goroutine 5757 [running]:
golang.org/x/tools/go/types/typeutil.Hasher.hashFor({0x8a8180?}, {0x9c02f8?, 0xc02b560210?})
	/home/abhishek/go/pkg/mod/golang.org/x/[email protected]/go/types/typeutil/map.go:302 +0x41f
golang.org/x/tools/go/types/typeutil.Hasher.Hash({0x202c393433357830?}, {0x9c02f8, 0xc02b560210})
	/home/abhishek/go/pkg/mod/golang.org/x/[email protected]/go/types/typeutil/map.go:226 +0x65
golang.org/x/tools/go/types/typeutil.Hasher.hashFor({0x8a8180?}, {0x9c0280?, 0xc02b515b40?})
	/home/abhishek/go/pkg/mod/golang.org/x/[email protected]/go/types/typeutil/map.go:253 +0x2d5
golang.org/x/tools/go/types/typeutil.Hasher.Hash({0x203a613430317830?}, {0x9c0280, 0xc02b515b40})
	/home/abhishek/go/pkg/mod/golang.org/x/[email protected]/go/types/typeutil/map.go:226 +0x65
golang.org/x/tools/go/types/typeutil.Hasher.hashTuple({0x2c31633835783020?}, 0xc02b43f068)
	/home/abhishek/go/pkg/mod/golang.org/x/[email protected]/go/types/typeutil/map.go:310 +0x5f
golang.org/x/tools/go/types/typeutil.Hasher.hashFor({0x8a8180?}, {0x9c0258?, 0xc02b54b940?})
	/home/abhishek/go/pkg/mod/golang.org/x/[email protected]/go/types/typeutil/map.go:276 +0x10c
golang.org/x/tools/go/types/typeutil.Hasher.Hash({0x3530317830202c39?}, {0x9c0258, 0xc02b54b940})
	/home/abhishek/go/pkg/mod/golang.org/x/[email protected]/go/types/typeutil/map.go:226 +0x65
golang.org/x/tools/go/types/typeutil.(*Map).At(0xc035ca0418, {0x9c0258, 0xc02b54b940})
	/home/abhishek/go/pkg/mod/golang.org/x/[email protected]/go/types/typeutil/map.go:88 +0x48
golang.org/x/tools/go/ssa.(*Program).needMethods(0xc035ca03c0, {0x9c0258?, 0xc02b54b940?}, 0x0)
	/home/abhishek/go/pkg/mod/golang.org/x/[email protected]/go/ssa/methods.go:156 +0x66
golang.org/x/tools/go/ssa.(*Program).needMethodsOf(0xc035ca03c0, {0x9c0258?, 0xc02b54b940?})
	/home/abhishek/go/pkg/mod/golang.org/x/[email protected]/go/ssa/methods.go:145 +0x70
golang.org/x/tools/go/ssa.(*Package).build(0xc0013ff7a0)
	/home/abhishek/go/pkg/mod/golang.org/x/[email protected]/go/ssa/builder.go:2272 +0x111
sync.(*Once).doSlow(0xc001404fb8?, 0x6e1fbe?)
	/usr/local/go/src/sync/once.go:68 +0xc2
sync.(*Once).Do(...)
	/usr/local/go/src/sync/once.go:59
golang.org/x/tools/go/ssa.(*Package).Build(...)
	/home/abhishek/go/pkg/mod/golang.org/x/[email protected]/go/ssa/builder.go:2260
golang.org/x/tools/go/ssa.(*Program).Build.func1(0x0?)
	/home/abhishek/go/pkg/mod/golang.org/x/[email protected]/go/ssa/builder.go:2244 +0x4c
created by golang.org/x/tools/go/ssa.(*Program).Build
	/home/abhishek/go/pkg/mod/golang.org/x/[email protected]/go/ssa/builder.go:2243 +0x19c

meetwithabhishek avatar Oct 02 '22 19:10 meetwithabhishek