Full Stack Developer

go 基本语法(一)

2019-04-23  本文已影响1人  samtake

变量

使用var关键字

内建变量类型

<details>
<summary>展开查看</summary>
bool string

(u)int,(u)int8,(u)int16,(u)int32,(u)int64,uintptr

byte,rune

float32,float64,complex64,complex128

</details>

常量

使用常量定义枚举类型

const (
    iOS = iota
    _
    vue
    golang
)
const (
    b = 1 << (10 * iota)
    kb
    mb
    gb
)
上一篇 下一篇

猜你喜欢

热点阅读