You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to golang/protobuf#567, file descriptor registration in the protobuf runtime is error-prone. If a file uses a relative path in an import statement that does not precisely match the path given to protoc to generate that file's corresponding Go code, then linking of descriptors can fail.
A possible work-around is to provide an API for users to register aliases for file paths. For example, a file may have been compiled with protoc and thus registered at runtime as foo.proto, but another file might import the same file via import "misc/foo.proto"; (e.g. with misc/ added to path). The API would allow users to register "misc/foo.proto" as an alias for "foo.proto". Since registration is global, the aliases can probably safely be global, too (e.g. registered in a package variable map [protected by mutex for thread-safety] that is queried from any calls to desc.LoadFileDescriptor).
The text was updated successfully, but these errors were encountered:
Due to golang/protobuf#567, file descriptor registration in the protobuf runtime is error-prone. If a file uses a relative path in an
import
statement that does not precisely match the path given toprotoc
to generate that file's corresponding Go code, then linking of descriptors can fail.A possible work-around is to provide an API for users to register aliases for file paths. For example, a file may have been compiled with
protoc
and thus registered at runtime asfoo.proto
, but another file might import the same file viaimport "misc/foo.proto";
(e.g. withmisc/
added to path). The API would allow users to register"misc/foo.proto"
as an alias for"foo.proto"
. Since registration is global, the aliases can probably safely be global, too (e.g. registered in a package variable map [protected by mutex for thread-safety] that is queried from any calls todesc.LoadFileDescriptor
).The text was updated successfully, but these errors were encountered: