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
Go packages can't be nested but you can nest namespaces in Thrift. If you have two Thrift files with the same "leaf" namespace name then when both namespaces are used together the generated Go code won't compile. The error is redeclared as imported package name ...
Eg for this thrift:
include "Person.Address.thrift"
include "Computer.Address.thrift"
struct Details
{
1 : optional Person.Address.Primary addr,
2 : optional Computer.Address.Primary ip,
}
the Go code looks something like this:
import (
"Person/Address"
"Computer/Address" // Address redeclared as imported package name
"git.apache.org/thrift.git/lib/go/thrift"
)
.....
type Details struct {
Addr *Address.Primary
Ip *Address.Primary
}
This is not a big problem but could be avoided by importing the package under a non-conflicting name like this:
import (
PersonAddress "Person/Address"
ComputerAddress "Computer/Address"
"git.apache.org/thrift.git/lib/go/thrift"
)
.....
type Details struct {
Addr *PersonAddress.Primary
Ip *ComputerAddress.Primary
}
The text was updated successfully, but these errors were encountered:
Go packages can't be nested but you can nest namespaces in Thrift. If you have two Thrift files with the same "leaf" namespace name then when both namespaces are used together the generated Go code won't compile. The error is redeclared as imported package name ...
Eg for this thrift:
the Go code looks something like this:
This is not a big problem but could be avoided by importing the package under a non-conflicting name like this:
The text was updated successfully, but these errors were encountered: