THRIFT-5019: Duplicate imports from multiple includes from a namespace
If a thrift file includes two files from the same namespace into a
separate file, the generated Go code has duplicate imports for that
namespace. This fixes that.
Client: go
diff --git a/lib/go/test/Makefile.am b/lib/go/test/Makefile.am
index 2a9d3f5..f5de26e 100644
--- a/lib/go/test/Makefile.am
+++ b/lib/go/test/Makefile.am
@@ -45,7 +45,8 @@
ConflictNamespaceTestC.thrift \
ConflictNamespaceTestD.thrift \
ConflictNamespaceTestSuperThing.thrift \
- ConflictNamespaceServiceTest.thrift
+ ConflictNamespaceServiceTest.thrift \
+ DuplicateImportsTest.thrift
mkdir -p gopath/src
grep -v list.*map.*list.*map $(THRIFTTEST) | grep -v 'set<Insanity>' > ThriftTest.thrift
$(THRIFT) $(THRIFTARGS) -r IncludesTest.thrift
@@ -71,6 +72,7 @@
$(THRIFT) $(THRIFTARGS) ConflictNamespaceTestD.thrift
$(THRIFT) $(THRIFTARGS) ConflictNamespaceTestSuperThing.thrift
$(THRIFT) $(THRIFTARGS) ConflictNamespaceServiceTest.thrift
+ $(THRIFT) $(THRIFTARGS) -r DuplicateImportsTest.thrift
GOPATH=`pwd`/gopath $(GO) get github.com/golang/mock/gomock || true
sed -i 's/\"context\"/\"golang.org\/x\/net\/context\"/g' gopath/src/github.com/golang/mock/gomock/controller.go || true
GOPATH=`pwd`/gopath $(GO) get github.com/golang/mock/gomock
@@ -94,7 +96,8 @@
unionbinarytest \
conflictnamespacetestsuperthing \
conflict/context/conflict_service-remote \
- servicestest/container_test-remote
+ servicestest/container_test-remote \
+ duplicateimportstest
GOPATH=`pwd`/gopath $(GO) test thrift tests dontexportrwtest
clean-local: