Closed gregorypa closed 2 years ago
Thank you for the report!
I guess I know the root cause
Does it work with this?
go-licenses check .
Hmm, my guess was wrong. Can you share more about your project setup?
Are you using GOPATH or go modules?
I think I fixed it, but the error means that you might not be using go modules yet. Can you confirm?
You can try installing go-licenses from master by go install github.com/google/go-licenses@master
.
Released v1.1.1 with the fix: https://github.com/google/go-licenses/releases/tag/v1.1.1.
fixed. thanks
go-licenses check main.go panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x92f859]
goroutine 1 [running]: github.com/google/go-licenses/licenses.Libraries.func1(0xc009f34140) /home/ubuntu/work/pkg/mod/github.com/google/go-licenses@v1.1.0/licenses/library.go:100 +0x259 golang.org/x/tools/go/packages.Visit.func1(0xc009f34140) /home/ubuntu/work/pkg/mod/golang.org/x/tools@v0.1.10/go/packages/visit.go:26 +0xaa golang.org/x/tools/go/packages.Visit({0xc003ea5b50, 0x1, 0x1?}, 0xc009d1b850, 0x0) /home/ubuntu/work/pkg/mod/golang.org/x/tools@v0.1.10/go/packages/visit.go:43 +0x10e github.com/google/go-licenses/licenses.Libraries({0x134b2a8?, 0xc00011c000?}, {0x1344960, 0xc003ea55a8}, {0xc0002b0ce0?, 0xc00035fd68?, 0xc00035fd90?}) /home/ubuntu/work/pkg/mod/github.com/google/go-licenses@v1.1.0/licenses/library.go:76 +0x22c main.checkMain(0x16d44e0?, {0xc0002b0ce0, 0x1, 0x1}) /home/ubuntu/work/pkg/mod/github.com/google/go-licenses@v1.1.0/check.go:47 +0x8e github.com/spf13/cobra.(Command).execute(0x16d44e0, {0xc0002b0cc0, 0x1, 0x1}) /home/ubuntu/work/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:856 +0x67c github.com/spf13/cobra.(Command).ExecuteC(0x16d4260) /home/ubuntu/work/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:974 +0x3b4 github.com/spf13/cobra.(*Command).Execute(...) /home/ubuntu/work/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:902 main.main() /home/ubuntu/work/pkg/mod/github.com/google/go-licenses@v1.1.0/main.go:72 +0x85