THRIFT-4797: Go import improvements
This change improves two problems in go code imports:
1. Always rename import the thrift package into "thrift", as we allow
the user to use a different library to replace the official one from
the compiler command line, this makes sure that in compiler generated
go code we can always blindly use "thrift.*".
2. We added auto rename import dedup in d9019fc5a4, but in that change
for system packages we always use the full import path as the dedup
identifier, so system package "database/sql/driver" would not be
detected as a conflict against a thrift go namespace of
"foo.bar.driver". Use the part after the last "/" in system packages
as the dedup identifier instead.
diff --git a/lib/go/test/Makefile.am b/lib/go/test/Makefile.am
index 9f174bb..cd0f33c 100644
--- a/lib/go/test/Makefile.am
+++ b/lib/go/test/Makefile.am
@@ -44,6 +44,8 @@
ConflictNamespaceTestB.thrift \
ConflictNamespaceTestC.thrift \
ConflictNamespaceTestD.thrift \
+ ConflictNamespaceTestE.thrift \
+ ConflictNamespaceTestF.thrift \
ConflictNamespaceTestSuperThing.thrift \
ConflictNamespaceServiceTest.thrift \
DuplicateImportsTest.thrift \
@@ -74,6 +76,8 @@
$(THRIFT) $(THRIFTARGS) ConflictNamespaceTestB.thrift
$(THRIFT) $(THRIFTARGS) ConflictNamespaceTestC.thrift
$(THRIFT) $(THRIFTARGS) ConflictNamespaceTestD.thrift
+ $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestE.thrift
+ $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestF.thrift
$(THRIFT) $(THRIFTARGS) ConflictNamespaceTestSuperThing.thrift
$(THRIFT) $(THRIFTARGS) ConflictNamespaceServiceTest.thrift
$(THRIFT) $(THRIFTARGS) -r DuplicateImportsTest.thrift
@@ -97,7 +101,7 @@
./gopath/src/dontexportrwtest \
./gopath/src/ignoreinitialismstest \
./gopath/src/unionbinarytest \
- ./gopath/src/conflictnamespacetestsuperthing \
+ ./gopath/src/conflict/super \
./gopath/src/conflict/context/conflict_service-remote \
./gopath/src/servicestest/container_test-remote \
./gopath/src/duplicateimportstest \