fishincat

导航

2014年11月23日 #

golang中string以及slice之间的一些问题

摘要: 好记性不如烂笔头o_O slice切片不会开辟新的空间a := []int{0,1,2,3}b := make([]int, 8)b = a[:]b[2] = 9fmt.Println(a)fmt.Println(b)输出:[0 1 9 3][0 1 9 3]string底层是用byte数组存的,并... 阅读全文

posted @ 2014-11-23 17:41 fishincat 阅读(264) 评论(0) 推荐(0) 编辑

Go Data Structures: Interfaces

摘要: 原文链接http://research.swtch.com/interfacesGo's interfaces—static, checked at compile time, dynamic when asked for—are, for me, the most exciting part of... 阅读全文

posted @ 2014-11-23 13:27 fishincat 阅读(143) 评论(0) 推荐(0) 编辑

go语言的selector

摘要: For aprimary expressionxthat is not apackage name, theselector expressionx.fdenotes the field or methodfof the valuex(or sometimes*x; see below). The ... 阅读全文

posted @ 2014-11-23 12:39 fishincat 阅读(650) 评论(0) 推荐(0) 编辑