Go
笨小孩的小跟班
这个作者很懒,什么都没留下…
展开
-
gocron源码解析(一)
GitHub地址:https://github.com/ouqiang/gocron原创 2022-03-01 17:34:48 · 204 阅读 · 0 评论 -
Golang中redis的使用
go-redis。。。redigo使用 go get 命令安装 redigo:go get github.com/gomodule/redigo/redisredigo 库中的 Conn 接口是操作 Redis 的主要接口。type Conn interface { // Close closes the connection. Close() error // Err returns a non-nil value when the connection is not usable.原创 2022-02-08 12:50:49 · 4658 阅读 · 0 评论 -
go get无法下载第三方库的解决方法
在host文件最后加下面代码即可192.30.253.113 github.com192.30.252.131 github.com185.31.16.185 github.global.ssl.fastly.net74.125.237.1 dl-ssl.google.com173.194.127.200 groups.google.com192.30.252.131 github.com185.31.16.185 github.global.ssl.fastly.net74.125.原创 2022-02-08 12:31:33 · 248 阅读 · 0 评论 -
golang随笔
goroot gopathflag StringVar String Parsego run xx.go --help #查看参数说明godoc同一目录,无子目录的源码文件需要被声明为同一代码包packageinternal 模块私有化包冲突:设置别名、点操作、匿名方式04 变量的重声明类型断言 X.(T) interface{}(_)([]String) 空接口 类型字面量切片的类型字面量中只有元素的类型,而没有长度Go 语言的切片类型属于引用类型,同属引用类型的还有字典类型、通道类.原创 2021-12-30 09:29:36 · 198 阅读 · 0 评论 -
golang的duck typing实现
package mainimport ( "fmt")type ISayHello interface { SayHello()}type Person struct {}func (person Person) SayHello() { fmt.Printf("Hello!")}type Duck struct {}func (duck Duck) SayHello() { fmt.Printf("ga ga ga!")}func gre原创 2021-12-27 13:55:27 · 1001 阅读 · 0 评论 -
GoLand选择SDK路径
此类问题目前两种方案:1.go的版本太高2.GOROOT和GOPATH设置的路径不合适原创 2021-11-23 10:13:11 · 1564 阅读 · 0 评论