File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -193,7 +193,7 @@ appendix:
193193 }
194194
195195 for name , field := range conf .FieldsFromStruct (t ) {
196- if isPrivate (name ) || isProtobuf (name ) {
196+ if isPrivate (name ) || isProtobuf (name ) || field . Ambiguous {
197197 continue
198198 }
199199 a .Fields [Identifier (name )] = c .use (field .Type )
Original file line number Diff line number Diff line change @@ -139,9 +139,15 @@ type A struct {
139139type B struct {
140140 AmbiguousField string
141141}
142+
143+ type C struct {
144+ A
145+ B
146+ }
142147type EnvAmbiguous struct {
143148 A
144149 B
150+ C C
145151}
146152
147153func TestCreateDoc_Ambiguous (t * testing.T ) {
@@ -159,6 +165,10 @@ func TestCreateDoc_Ambiguous(t *testing.T) {
159165 "OkField" : {
160166 Kind : "int" ,
161167 },
168+ "C" : {
169+ Kind : "struct" ,
170+ Name : "C" ,
171+ },
162172 },
163173 Types : map [TypeName ]* Type {
164174 "A" : {
@@ -174,6 +184,14 @@ func TestCreateDoc_Ambiguous(t *testing.T) {
174184 "AmbiguousField" : {Kind : "string" },
175185 },
176186 },
187+ "C" : {
188+ Kind : "struct" ,
189+ Fields : map [Identifier ]* Type {
190+ "A" : {Kind : "struct" , Name : "A" },
191+ "B" : {Kind : "struct" , Name : "B" },
192+ "OkField" : {Kind : "int" },
193+ },
194+ },
177195 },
178196 }
179197
You can’t perform that action at this time.
0 commit comments