...
1
16
17 package resolver
18
19 import (
20 `reflect`
21 `testing`
22 )
23
24 type bas struct {
25 Y int `json:"Y"`
26 }
27
28 type bat struct {
29 bas
30 }
31
32 type bau struct {
33 Y int
34 }
35
36 type bay struct {
37 Y int `json:"Y"`
38 }
39
40 type baz struct {
41 Y int `json:"W"`
42 }
43
44 type bar struct {
45 bat
46 bau
47 *bay
48 baz
49 }
50
51 type PackageError struct {
52 ImportStack []string
53 Pos string
54 Err error
55 IsImportCycle bool
56 Hard bool
57 alwaysPrintStack bool
58 Y *int
59 }
60
61 type Foo struct {
62 X int
63 *PackageError
64 bar
65 }
66
67 func TestResolver_ResolveStruct(t *testing.T) {
68 for _, fv := range ResolveStruct(reflect.TypeOf(Foo{})) {
69 println(fv.String())
70 }
71 }
72
View as plain text