随笔分类 -  golang

资源竞争
摘要:出现原因 GO type DB struct { mutex sync.Mutex store map[string][3]float64 } func (db DB) nearest(target [3]float64) string { var filename string db.mutex. 阅读全文

posted @ 2018-03-24 12:32 cucy_to 阅读(381) 评论(0) 推荐(0)

channel
摘要:死锁 go package main import "fmt" func callerA(c chan string) { c 阅读全文

posted @ 2018-03-24 11:12 cucy_to 阅读(163) 评论(0) 推荐(0)

11.exporting 导出
摘要:Declare and access exported identifiers Pkg Declare and access exported identifiers Main Declare unexported identifiers and restrictions Pkg ( Declare 阅读全文

posted @ 2018-03-17 19:10 cucy_to 阅读(169) 评论(0) 推荐(0)

10.functions
摘要:Return multiple values go // Sample program to show how functions can return multiple values while using // named and struct types. package main impor 阅读全文

posted @ 2018-03-17 18:57 cucy_to 阅读(152) 评论(0) 推荐(0)

9.interface
摘要:method set go package main import "fmt" // Sample program to show how polymorphic behavior with interfaces. // 示例程序演示多态行为与接口的关系。 // reader is an inter 阅读全文

posted @ 2018-03-17 17:38 cucy_to 阅读(158) 评论(0) 推荐(0)

8. Embedding 嵌入
摘要:Declaring Fields Embedding types Embedded types and interfaces Outer and inner type interface implementations 外部和内部类型接口实现。 练习 阅读全文

posted @ 2018-03-17 01:19 cucy_to 阅读(145) 评论(0) 推荐(0)

7.pointers
摘要:Sharing data I Sharing data II Escape Analysis 溢出分析 练习 阅读全文

posted @ 2018-03-17 00:51 cucy_to 阅读(161) 评论(0) 推荐(0)

6.struct_types
摘要:Declare, create and initialize struct types Anonymous struct types Named vs Unnamed types 命名类型和匿名类型 结构体类型排列 阅读全文

posted @ 2018-03-16 23:47 cucy_to 阅读(183) 评论(0) 推荐(0)

5.map
摘要:Declare, initialize and iterate Map literals and delete Map key restrictions key类型 阅读全文

posted @ 2018-03-16 23:12 cucy_to 阅读(129) 评论(0) 推荐(0)

4.slice
摘要:Reference Types Taking slices of slices Appending slices go // Sample program to show how to grow a slice using the built in function append // and ho 阅读全文

posted @ 2018-03-16 20:57 cucy_to 阅读(158) 评论(0) 推荐(0)

3.constants
摘要:... iota go // Sample program to show how iota works. package main import "fmt" func main() { const ( A1 = iota // 0 : Start at 0 B1 = iota // 1 : Inc 阅读全文

posted @ 2018-03-16 00:40 cucy_to 阅读(227) 评论(0) 推荐(0)

2.arrays
摘要:```go package main import "fmt" func main() { // Declare an array of five strings that is initialized // to its zero value. var strings [5]string stri 阅读全文

posted @ 2018-03-15 23:53 cucy_to 阅读(103) 评论(0) 推荐(0)

1.go变量
摘要:练习 阅读全文

posted @ 2018-03-15 23:04 cucy_to 阅读(221) 评论(0) 推荐(0)

导航