package mainimport ( "github.com/davecgh/go-spew/spew")type ( SomeStruct struct { Field1 string Field2 int Field3 *somePointer } somePointer struct { field string })func main() { s := SomeStruct{ Field1: "Yahoo", Field2: 500, Field3: &somePointer{"I want to see what is in here"}, } spew.Dump(s)}
将为您提供以下输出:
(main.SomeStruct) { Field1: (string) "Yahoo", Field2: (int) 500, Field3: (*main.somePointer)(0x2102a7230)({ field: (string) "I want to see what is in here" })}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)