随笔分类 - 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.
阅读全文
摘要:死锁 go package main import "fmt" func callerA(c chan string) { c
阅读全文
摘要:Declare and access exported identifiers Pkg Declare and access exported identifiers Main Declare unexported identifiers and restrictions Pkg ( Declare
阅读全文
摘要:Return multiple values go // Sample program to show how functions can return multiple values while using // named and struct types. package main impor
阅读全文
摘要:method set go package main import "fmt" // Sample program to show how polymorphic behavior with interfaces. // 示例程序演示多态行为与接口的关系。 // reader is an inter
阅读全文
摘要:Declaring Fields Embedding types Embedded types and interfaces Outer and inner type interface implementations 外部和内部类型接口实现。 练习
阅读全文
摘要:Sharing data I Sharing data II Escape Analysis 溢出分析 练习
阅读全文
摘要:Declare, create and initialize struct types Anonymous struct types Named vs Unnamed types 命名类型和匿名类型 结构体类型排列
阅读全文
摘要:Declare, initialize and iterate Map literals and delete Map key restrictions key类型
阅读全文
摘要: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
阅读全文
摘要:... 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
阅读全文
摘要:```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
阅读全文

浙公网安备 33010602011771号