protogen: automatic handling of imports
The GoIdent type is now a tuple of import path and name. Generated files
have an associated import path. Writing a GoIdent to a generated file
qualifies the name if the identifier is from a different package.
All necessary imports are automatically added to generated Go files.
Change-Id: I839e0b7aa8ec967ce178aea4ffb960b62779cf74
Reviewed-on: https://go-review.googlesource.com/133635
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
diff --git a/protogen/names_test.go b/protogen/names_test.go
index 021e71a..05e698e 100644
--- a/protogen/names_test.go
+++ b/protogen/names_test.go
@@ -8,8 +8,7 @@
func TestCamelCase(t *testing.T) {
tests := []struct {
- in string
- want GoIdent
+ in, want string
}{
{"one", "One"},
{"one_two", "OneTwo"},