Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support go modules #81

Open
kheraankit opened this issue Nov 13, 2019 · 3 comments
Open

support go modules #81

kheraankit opened this issue Nov 13, 2019 · 3 comments

Comments

@kheraankit
Copy link

kheraankit commented Nov 13, 2019

We are running into following error when trying to configure.

can't load package: package github.com/protocolbuffers/protobuf: unknown import path "github.com/protocolbuffers/protobuf": cannot find module providing package github.com/protocolbuffers/protobuf

go list -f '{{ .Dir }}' -m github.com/protocolbuffers/protobuf
$GOPATH/pkg/mod/github.com/protocolbuffers/[email protected]+incompatible

@kheraankit
Copy link
Author

Was able to go past errors, looks like have to add to proto_path and during import use relative path.
Maybe add to documentation?

protoc --proto_path="./" --proto_path=`go list -f '{{ .Dir }}' -m github.com/mwitkow/go-proto-validators` --proto_path=`go list -f '{{ .Dir }}' -m github.com/protocolbuffers/protobuf` --govalidators_out=../.gen --go_out=plugins=grpc:../.gen *.proto

in your project .proto file doe import "validator.proto";

@AlekSi
Copy link

AlekSi commented Jan 31, 2020

Why you use github.com/protocolbuffers/protobuf instead of github.com/golang/protobuf ?

@HelloZouYou
Copy link

HelloZouYou commented May 19, 2020

hello,i tried it, but got code like

import (
    _ "."
    ...
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants