kevinconway / wrapgen

Interface wrapper generator for Go
Apache License 2.0
26 stars 9 forks source link

Update golang.org/x/tools to v0.18.0 #16

Closed kl177 closed 5 months ago

kl177 commented 5 months ago

After updating Go to version 1.22 this tool gives such panic:

panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference            
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1049795c0]                  

goroutine 51 [running]:                                                                    
go/types.(*Checker).handleBailout(0x14000738000, 0x14000957c38)              
        /usr/local/go/src/go/types/check.go:367 +0x9c                                                                                                                                  
panic({0x104aef520?, 0x104e243d0?})                                                                                                                                                    
        /usr/local/go/src/runtime/panic.go:770 +0x124                        
go/types.(*StdSizes).Sizeof(0x0, {0x104b6a108, 0x104e2a3a0})                                                                                                                           
...
go/types.(*Checker).Files(...)
        /usr/local/go/src/go/types/check.go:372
golang.org/x/tools/go/packages.(*loader).loadPackage(0x140000d8180, 0x1400023b4e0)
        /Users/john/dev/go/pkg/mod/golang.org/x/tools@v0.0.0-20200928112810-42b62fc93869/go/packages/packages.go:934 +0x5e8
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
        /Users/john/dev/go/pkg/mod/golang.org/x/tools@v0.0.0-20200928112810-42b62fc93869/go/packages/packages.go:772 +0x178
sync.(*Once).doSlow(0x1045fccd0?, 0x140001123c0?)
        /usr/local/go/src/sync/once.go:74 +0x100

The issue comes from golang.org/x/tools package. Update to the latest version (v0.18.0) fixes the issue.

kevinconway commented 5 months ago

Thanks for sharing the fix! I'll merge and tag this with a new release.

kevinconway commented 5 months ago

Here's the new release: https://github.com/kevinconway/wrapgen/releases/tag/v2.6.0

Thanks again for the pull request!