Guest User

Untitled

a guest
Feb 24th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. type Test struct {
  6. Name string
  7. Age int
  8. }
  9.  
  10. func main() {
  11. t := &Test{Name: "haha", Age: 11}
  12. fmt.Printf("%#v\n", t) // 显示包名 类型名 字段名 字段值
  13. fmt.Printf("%+v\n", t) // 显示 类型名 字段名 字段值
  14. fmt.Printf("%v\n", t) // 显示 字段值
  15. }
Add Comment
Please, Sign In to add comment