Avoid duplicate generation of enum code when the enum is inside a nested message.
        Fixes #2.

R=r
CC=golang-dev
http://codereview.appspot.com/1744041
diff --git a/compiler/testdata/test.pb.go.golden b/compiler/testdata/test.pb.go.golden
index 8a87b16..397bea4 100644
--- a/compiler/testdata/test.pb.go.golden
+++ b/compiler/testdata/test.pb.go.golden
@@ -69,6 +69,24 @@
 	return &e
 }
 
+type Reply_Entry_Game int32
+const (
+	Reply_Entry_FOOTBALL = 1
+	Reply_Entry_TENNIS = 2
+)
+var Reply_Entry_Game_name = map[int32] string {
+	1: "FOOTBALL",
+	2: "TENNIS",
+}
+var Reply_Entry_Game_value = map[string] int32 {
+	"FOOTBALL": 1,
+	"TENNIS": 2,
+}
+func NewReply_Entry_Game(x int32) *Reply_Entry_Game {
+	e := Reply_Entry_Game(x)
+	return &e
+}
+
 type Request struct {
 	Key	[]int64	"PB(varint,1,rep,name=key)"
 	ImportedMessage	*imp.ImportedMessage	"PB(bytes,2,opt,name=imported_message)"
@@ -152,4 +170,5 @@
 	proto.RegisterEnum("my_test.HatType", HatType_name, HatType_value)
 	proto.RegisterEnum("my_test.Days", Days_name, Days_value)
 	proto.RegisterEnum("my_test.Request_Color", Request_Color_name, Request_Color_value)
+	proto.RegisterEnum("my_test.Reply_Entry_Game", Reply_Entry_Game_name, Reply_Entry_Game_value)
 }
diff --git a/compiler/testdata/test.proto b/compiler/testdata/test.proto
index 2f64132..9f3c75f 100644
--- a/compiler/testdata/test.proto
+++ b/compiler/testdata/test.proto
@@ -64,6 +64,10 @@
     required int64 key_that_needs_1234camel_CasIng = 1;
     optional int64 value = 2 [default=7];
     optional int64 _my_field_name_2 = 3;
+    enum Game {
+      FOOTBALL = 1;
+      TENNIS = 2;
+    }
   }
   repeated Entry found = 1;
   extensions 100 to max;