![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Go
关于Go学习的一些exp
pacmoc
用代码托起我的不切实际
展开
-
A Tour of Go: Basic (Go语言入门基础部分)
以下资源都来自A Tour of Go。可以进行一些简单的交互式的在线编程。1 欢迎1.1 hello,世界hello.gopackage mainimport "fmt"func main() { fmt.Println("Hello, 世界")}1.2 sandbox.gosandbox.gopackage mainimport ( "fmt" &quo原创 2018-12-13 20:35:00 · 569 阅读 · 0 评论 -
go语言入门:方法和接口
以下资源来自A Tour of Go。答案自己完成或参考完成1 方法 (定义类型的方法)Go does not have classes. However, you can define methods on types.A method is a function with a special receiver argument.The receiver appears in its ...原创 2018-12-13 23:36:13 · 352 阅读 · 0 评论 -
分布式锁
简单介绍:sync.WaitGroup等待一定数量的gorutine。 wg.Add(num)增加num个。 wg.Done相当于等待的gorutine数量减少1。当等待的gorutine数量为0时,结束。package mainimport ( "sync")// 全局变量var counter intfunc main() { var wg sync.Wa...原创 2018-12-29 22:47:05 · 128 阅读 · 0 评论