当前位置:网站首页>Golang foundation - data type

Golang foundation - data type

2022-07-07 01:46:00 The hunter is eating meat

1、 data type

1) Basic types

  • Numbers
    • Integer types : int8、int16、int32、int64、unit8、unit16、unit32、unit64
    • Floating point type : float32、float64
    • Other number types
    int:  32  or  64  position 
    uint:  32  or  64  position 
    byte:  uint8  Type alias for 
    rune:  int32  Type alias for 	
    uintptr:   Unsigned integer , Used to store a pointer 
    
  • Boolean type (bool): Can only be constants true perhaps false.
  • character string (string)

2) The compound type

  • Array
  • Structure . By combining simple types , To express more complex data structures .

3) Reference type

  • The pointer
  • section (slice)
  • map
  • channel
  • interface( Interface )
  • Function type

When declaring variables of reference type , The variables created are called headers (header) value .

In terms of technical details , String is also a reference type .

原网站

版权声明
本文为[The hunter is eating meat]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207061749454296.html