Codebase list golang-github-go-logr-logr / 79293f4
funcr: Check CanInterface() on struct fields Tim Hockin 2 years ago
2 changed file(s) with 8 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
356356 // reflect says this field is only defined for non-exported fields.
357357 continue
358358 }
359 if !v.Field(i).CanInterface() {
360 // reflect isn't clear exactly what this means, but we can't use it.
361 continue
362 }
359363 name := fld.Name
360364 omitempty := false
361365 if tag, found := fld.Tag.Lookup("json"); found {
201201 {val: [4]int{9, 3, 7, 6}},
202202 {
203203 val: struct {
204 Int int
205 String string
204 Int int
205 notExported string
206 String string
206207 }{
207 93, "seventy-six",
208 93, "you should not see this", "seventy-six",
208209 },
209210 },
210211 {val: map[string]int{}},