File tree 2 files changed +19
-1
lines changed
2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -193,7 +193,7 @@ appendix:
193
193
}
194
194
195
195
for name , field := range conf .FieldsFromStruct (t ) {
196
- if isPrivate (name ) || isProtobuf (name ) {
196
+ if isPrivate (name ) || isProtobuf (name ) || field . Ambiguous {
197
197
continue
198
198
}
199
199
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 {
139
139
type B struct {
140
140
AmbiguousField string
141
141
}
142
+
143
+ type C struct {
144
+ A
145
+ B
146
+ }
142
147
type EnvAmbiguous struct {
143
148
A
144
149
B
150
+ C C
145
151
}
146
152
147
153
func TestCreateDoc_Ambiguous (t * testing.T ) {
@@ -159,6 +165,10 @@ func TestCreateDoc_Ambiguous(t *testing.T) {
159
165
"OkField" : {
160
166
Kind : "int" ,
161
167
},
168
+ "C" : {
169
+ Kind : "struct" ,
170
+ Name : "C" ,
171
+ },
162
172
},
163
173
Types : map [TypeName ]* Type {
164
174
"A" : {
@@ -174,6 +184,14 @@ func TestCreateDoc_Ambiguous(t *testing.T) {
174
184
"AmbiguousField" : {Kind : "string" },
175
185
},
176
186
},
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
+ },
177
195
},
178
196
}
179
197
You can’t perform that action at this time.
0 commit comments