-
Notifications
You must be signed in to change notification settings - Fork 73
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
Error compiling generated code with third party imports #6
Comments
Hiii @gmather! This is indeed a real issue. Right now the check for foreign imports is really naive: vtprotobuf/features/marshal/marshalto.go Line 629 in 6ae7946
I need to come up with a better way to perform this check. Let me think it through. |
The related issue:
The generated code has error: |
@vmg The test would be performed before invoking any For example, for the "unmarshal" feature, the generated code could be something like: if o, ok := interface{}(m.MY_FIELD).(interface{
UnmarshalVT([]byte) error
});ok{
if err := o.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil {
return err
}
}else{
if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.MY_FIELD); err!=nil{
return err
}
} |
I like that suggestion! I've implemented it in #7 -- can you guys give this a go and see if it works in your codebases? |
Hello,
I was looking to experiment with this and ran into the following error:
The protobuf files that are complaining import files like:
with messages that look like:
The
google/rpc/status.proto
file is copied locally for the code generation, but the generated code is importing the Go module fromgoogle.golang.org/genproto/googleapis/rpc/status
so it's not part of the vtproto generation steps.Is this an issue that you've had to resolve or any suggestions on how to approach this?
The text was updated successfully, but these errors were encountered: