-
Notifications
You must be signed in to change notification settings - Fork 811
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
How to generate right Import paths #257
Comments
Does this look like it would solve your issue golang/protobuf#63 ? |
Trouble is this parameter is -seemingly- not doing anything without this PR: golang/protobuf#64 |
Well, only way is to use |
I would really want to know why they aren't merging this pull request golang/protobuf#64 |
I can appreciate your desire to remain compatible with upstream, but it seems to me that they are largely uninterested in (or don't have the bandwidth for) extra features, usability fixes, or even in some cases bug fixes. Just looking through the open issues and pull requests shows very little activity and a large number of unacknowledged issues and pull-requests. The last PR was a bug fix 2 days ago, but prior to that the last merged PR was from November last year. In particular, as you say, the way paths are mapped is very clunky (to put it mildly). They've acknowledged this for years, but no movement has been made to rectify it. My particular pet peeve is golang/protobuf#39, which is now almost two years old. Maybe it's time to consider diverging? |
Is merging golang/protobuf#64 enough? |
hello? |
The complaint about # a.proto
syntax = "proto2";
package a;
option go_package = "github.com/neild/foo/a";
import "b.proto";
message MessageA {
optional b.MessageB field = 1;
} syntax = "proto2";
package b;
option go_package = "github.com/neild/foo/b";
message MessageB {} protoc --go_out=$GOPATH/src a.proto And the imports in import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import b "github.com/neild/foo/b" Specifying the import path will influence the generated filenames. In the common case (no vendoring), |
@alecthomas @ashishnegi @theobat What do you think about neild's comment? |
this still has not been solved yet? |
Solved by adding go_package option to proto as referenced in this comment: gogo/protobuf#257 (comment)
Hi Thanks for the project. I have having problems with getting correct import paths.
I have following directory structure
b.proto
's has import fora.proto
with lineimport "dproto/a.proto";
In
root
directory, i runprotoc --gofast_out=plugins=grpc,import_prefix=github.com/myrepo/repo:. abc/b.proto
I get no errors and
b.pb.go
is generated with following imports :I want the
import_prefix
for only theimport
path i have given inb.proto
.I also found that projects like
etcd
listed on main page , use same kind of imports across directories.How can i solve this problem ? Am i using wrong arguments ?
Version information :
The text was updated successfully, but these errors were encountered: