zxy16305 / Blog

bak for hexo
3 stars 1 forks source link

Golang #20

Open zxy16305 opened 6 years ago

zxy16305 commented 6 years ago

特性详见 官方教程 && 本文概要其特性 -> 相当于目录

zxy16305 commented 6 years ago

Basics-1

与C申明语法的不同

func main() { a, b := swap("hello", "world") fmt.Println(a, b) }

+ [返回值命名](https://tour.golang.org/basics/7),如
``` Go
func split(sum int) (x, y int) {
    x = sum * 4 / 9
    y = sum - x
    return 
        // return 1,2
}
zxy16305 commented 6 years ago

Basic-2

zxy16305 commented 6 years ago

Basic-3

只记关键字了