
Go
笨小孩的小跟班
这个作者很懒,什么都没留下…
展开
-
gocron源码解析(一)
GitHub地址:https://github.com/ouqiang/gocron原创 2022-03-01 17:34:48 · 265 阅读 · 0 评论 -
Golang中redis的使用
go-redis 。。。 redigo 使用 go get 命令安装 redigo: go get github.com/gomodule/redigo/redis redigo 库中的 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 · 4793 阅读 · 0 评论 -
go get无法下载第三方库的解决方法
在host文件最后加下面代码即可 192.30.253.113 github.com 192.30.252.131 github.com 185.31.16.185 github.global.ssl.fastly.net 74.125.237.1 dl-ssl.google.com 173.194.127.200 groups.google.com 192.30.252.131 github.com 185.31.16.185 github.global.ssl.fastly.net 74.125.原创 2022-02-08 12:31:33 · 300 阅读 · 0 评论 -
golang随笔
goroot gopath flag StringVar String Parse go run xx.go --help #查看参数说明 godoc 同一目录,无子目录的源码文件需要被声明为同一代码包package internal 模块私有化 包冲突:设置别名、点操作、匿名方式 04 变量的重声明 类型断言 X.(T) interface{}(_)([]String) 空接口 类型字面量 切片的类型字面量中只有元素的类型,而没有长度 Go 语言的切片类型属于引用类型,同属引用类型的还有字典类型、通道类.原创 2021-12-30 09:29:36 · 316 阅读 · 0 评论 -
golang的duck typing实现
package main import ( "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 · 1062 阅读 · 0 评论 -
GoLand选择SDK路径
此类问题目前两种方案: 1.go的版本太高 2.GOROOT和GOPATH设置的路径不合适原创 2021-11-23 10:13:11 · 1666 阅读 · 0 评论