grpc-gateway
grpc-gateway copied to clipboard
unable to install`protoc-gen-openapiv2` plugin
🐛 Bug Report
Trying to run go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2
to install the protoc-gen-openapiv2 plugin, but I'm thrown back this panic message, along with the stack trace:
panic: modindex.GetPackage called with empty modroot
goroutine 19 [running]:
cmd/go/internal/modindex.GetModule({0x0, 0x0})
/usr/local/go/src/cmd/go/internal/modindex/read.go:157 +0x125
cmd/go/internal/modindex.GetPackage({0x0, 0x0}, {0xc0000dc320, 0x45})
/usr/local/go/src/cmd/go/internal/modindex/read.go:135 +0x31
cmd/go/internal/modload.scanDir({0x0?, 0x3e?}, {0xc0000dc320, 0x45}, 0x0?)
/usr/local/go/src/cmd/go/internal/modload/load.go:2105 +0x4b
cmd/go/internal/modload.(*loader).load(0xc00023f110, {0x172fa10, 0xc00009e000}, 0xc00023f2b0)
/usr/local/go/src/cmd/go/internal/modload/load.go:1734 +0x35f
cmd/go/internal/modload.(*loader).pkg.func1.1()
/usr/local/go/src/cmd/go/internal/modload/load.go:1517 +0x29
cmd/go/internal/par.(*Queue).Add.func1()
/usr/local/go/src/cmd/go/internal/par/queue.go:58 +0x7d
created by cmd/go/internal/par.(*Queue).Add
/usr/local/go/src/cmd/go/internal/par/queue.go:56 +0x225
To Reproduce
(Write your steps here:)
- Execute
go install [github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2](http://github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2)
Expected behavior
protoc-gen-openapiv2 to be installed locally.
Actual Behavior
Here is the stack trace:
panic: modindex.GetPackage called with empty modroot
goroutine 19 [running]:
cmd/go/internal/modindex.GetModule({0x0, 0x0})
/usr/local/go/src/cmd/go/internal/modindex/read.go:157 +0x125
cmd/go/internal/modindex.GetPackage({0x0, 0x0}, {0xc0000dc320, 0x45})
/usr/local/go/src/cmd/go/internal/modindex/read.go:135 +0x31
cmd/go/internal/modload.scanDir({0x0?, 0x3e?}, {0xc0000dc320, 0x45}, 0x0?)
/usr/local/go/src/cmd/go/internal/modload/load.go:2105 +0x4b
cmd/go/internal/modload.(*loader).load(0xc00023f110, {0x172fa10, 0xc00009e000}, 0xc00023f2b0)
/usr/local/go/src/cmd/go/internal/modload/load.go:1734 +0x35f
cmd/go/internal/modload.(*loader).pkg.func1.1()
/usr/local/go/src/cmd/go/internal/modload/load.go:1517 +0x29
cmd/go/internal/par.(*Queue).Add.func1()
/usr/local/go/src/cmd/go/internal/par/queue.go:58 +0x7d
created by cmd/go/internal/par.(*Queue).Add
/usr/local/go/src/cmd/go/internal/par/queue.go:56 +0x225
Your Environment
Mac OS Ventura 13.0, Apple M1 Pro
Hi, what Go version are you using? I wasn't able to reproduce this error with Go 1.19.3.