go-proto-gql: Go install fails

I’m using Go 1.16.2 go install requires me to run go get and go get fails.

> go install github.com/danielvladco/go-proto-gql/protoc-gen-gql
no required module provides package github.com/danielvladco/go-proto-gql/protoc-gen-gql; to add it:
	go get github.com/danielvladco/go-proto-gql/protoc-gen-gql


> go get github.com/danielvladco/go-proto-gql/protoc-gen-gql
# github.com/danielvladco/go-proto-gql/pkg/generator
go/pkg/mod/github.com/danielvladco/go-proto-gql@v0.8.0/pkg/generator/generator.go:634:68: cannot use gql.E_Field (type *"github.com/gogo/protobuf/proto".ExtensionDesc) as type protoreflect.ExtensionType in argument to "google.golang.org/protobuf/proto".GetExtension:
	*"github.com/gogo/protobuf/proto".ExtensionDesc does not implement protoreflect.ExtensionType (missing InterfaceOf method)
go/pkg/mod/github.com/danielvladco/go-proto-gql@v0.8.0/pkg/generator/utils.go:16:67: cannot use gql.E_RpcType (type *"github.com/gogo/protobuf/proto".ExtensionDesc) as type protoreflect.ExtensionType in argument to "google.golang.org/protobuf/proto".GetExtension:
	*"github.com/gogo/protobuf/proto".ExtensionDesc does not implement protoreflect.ExtensionType (missing InterfaceOf method)
go/pkg/mod/github.com/danielvladco/go-proto-gql@v0.8.0/pkg/generator/utils.go:27:68: cannot use gql.E_SvcType (type *"github.com/gogo/protobuf/proto".ExtensionDesc) as type protoreflect.ExtensionType in argument to "google.golang.org/protobuf/proto".GetExtension:
	*"github.com/gogo/protobuf/proto".ExtensionDesc does not implement protoreflect.ExtensionType (missing InterfaceOf method)

Any idea on how to solve this?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

when I delete go.mod and go.sum and run go mod init on my existing directory, the following is what is in my go.mod.

go 1.16

require (
	google.golang.org/grpc v1.33.2
	google.golang.org/protobuf v1.26.0
)

Then I get the error:

 go get -t github.com/danielvladco/go-proto-gql/protoc-gen-gogql@v0.8.2
github.com/danielvladco/go-proto-gql/protoc-gen-gogql imports
	github.com/danielvladco/go-proto-gql/pkg/generator imports
	github.com/danielvladco/go-proto-gql/pb: ambiguous import: found package github.com/danielvladco/go-proto-gql/pb in multiple modules:
	github.com/danielvladco/go-proto-gql v0.8.2 (/Users/zichuan/go/pkg/mod/github.com/danielvladco/go-proto-gql@v0.8.2/pb)
	github.com/danielvladco/go-proto-gql/pb v0.6.0 (/Users/zichuan/go/pkg/mod/github.com/danielvladco/go-proto-gql/pb@v0.6.0)

However, after I manually delete the requires, the go get -t github.com/danielvladco/go-proto-gql/protoc-gen-gogql@v0.8.2 succeeds! Even after adding back the two lines, it still works šŸŽ‰

@DBL-Lee Please try the steps above and check if your issue is solved, if yes please close the issue

I was able to reproduce the issue with go 1.16. I will fix it the following days.

Please use this command outside go module directory for now

 go install github.com/danielvladco/go-proto-gql/protoc-gen-gql@v0.8.0