摘要: 转载:https://studygolang.com/articles/12913?fr=sidebar 在源代码中字面量可以描述像数字,字符串,布尔等类型的固定值。Go 和 JavaScript、Python 语言一样,即便是复合类型(数组,字典,切片,结构体)也允许使用字面量。Golang 阅读全文
posted @ 2018-08-29 10:58 叨叨的蜗牛 阅读(1209) 评论(0) 推荐(0) 编辑
摘要: package main import "fmt" import "os" type point struct { x, y int } func main() { //Go 为常规 Go 值的格式化设计提供了多种打印方式。例如,这里打印了 point 结构体的一个实例。 p := point{1, 阅读全文
posted @ 2018-08-29 09:33 叨叨的蜗牛 阅读(841) 评论(0) 推荐(0) 编辑