William Basics

Keep learning, never ending.

Go的函数

Go的函数 Go函数的定义以 func 关键词开头。 匿名函数 Go支持匿名函数,常常用于函数式编程中。匿名函数又被称为 闭包(closure) 多个返回值的函

Go 编译和打包

Go 编译和打包 你可以使用 go tool compile 命令来将代码编译为 .o (object)文件。 object文件中是go源代码的机器码。一般情况下,是无法直接执行的。

Go and JSON

Go - JSON encoding/json 包提供了对JSON格式文本的支持。 encoding/json 提供了4个函数 Encode() Decode() Marshal() Unmarshal() 前两者操作单个对象,后两者操作多个对象。 Encode and Decode JSON样例文件-readm

Go的基本数据类型

Go的基本数据类型 数字数据类型 整数 Go 支持 int8, int16, int32, int64, uint8, uint16, uint32, 以及 uint64。 一般直接用 int 和 unint 。 另外,byte 是 uint8 的别名。 浮点数 Go 支持 float32 和 float64 。前者