File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change
1
+ # ## Go template
2
+ # If you prefer the allow list template instead of the deny list, see community template:
3
+ # https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
4
+ #
5
+ # Binaries for programs and plugins
6
+ * .exe
7
+ * .exe~
8
+ * .dll
9
+ * .so
10
+ * .dylib
11
+
12
+ # Test binary, built with `go test -c`
13
+ * .test
14
+
15
+ # Output of the go coverage tool, specifically when used with LiteIDE
16
+ * .out
17
+
18
+ # Go workspace file
19
+ go.work
20
+
21
+ .idea /
22
+ .vscode /
23
+
Original file line number Diff line number Diff line change @@ -48,8 +48,12 @@ func fields(obj any) []fieldInfo {
48
48
49
49
for i := 0 ; i < objValue .NumField (); i ++ {
50
50
fieldType := objValue .Type ().Field (i )
51
- if fieldType .Anonymous && fieldType .Type .Kind () == reflect .Struct {
52
- result = append (result , fields (objValue .Field (i ).Addr ().Interface ())... )
51
+ if fieldType .Anonymous {
52
+ if fieldType .Type .Kind () == reflect .Struct {
53
+ result = append (result , fields (objValue .Field (i ).Addr ().Interface ())... )
54
+ } else if fieldType .Type .Kind () == reflect .Ptr && fieldType .Type .Elem ().Kind () == reflect .Struct {
55
+ result = append (result , fields (objValue .Field (i ).Interface ())... )
56
+ }
53
57
} else if ! fieldType .Anonymous {
54
58
result = append (result , fieldInfo {
55
59
FieldValue : objValue .Field (i ),
You can’t perform that action at this time.
0 commit comments