1、代码
package main
import "fmt"
type Person struct {
name string
age int
sex string
}
func main() {
p := &Person{name: "xxx", age: 18, sex: "男"}
fmt.Printf("%v\n", p)
fmt.Printf("%+v\n", p)
fmt.Printf("%#v\n", p)
}
2、输出
package main
import "fmt"
type Person struct {
name string
age int
sex string
}
func main() {
p := &Person{name: "xxx", age: 18, sex: "男"}
fmt.Printf("%v\n", p)
fmt.Printf("%+v\n", p)
fmt.Printf("%#v\n", p)
}