Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

解析2层结构体失败 #1

Closed
gpBlockchain opened this issue Jul 13, 2021 · 1 comment
Closed

解析2层结构体失败 #1

gpBlockchain opened this issue Jul 13, 2021 · 1 comment

Comments

@gpBlockchain
Copy link

type A struct {
aa string
a *B
}

type B struct {
aa string
a string
}

func Test_1(t *testing.T) {

a :=A{"aa",&B{"bb","nil"}}
xfmt.Enable()
fmt.Println(xfmt.Sprintf("%+v", a))

}
result:
=== RUN Test_1
{aa:aa a:0xc000195f20}
--- PASS: Test_1 (0.00s)
PASS

@onanying
Copy link
Member

@gpBlockchain 字段要大写,Public 的字段才能解析到

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants