1、定时器停止 示例: package main import ( "fmt" "time" ) func main() { timer := time.NewTimer(3 * time.Second) go func() { <-timer.C ...
windows安装redis 软件包下载地址: https: github.com MicrosoftArchive redis releases . 安装 gt 下一步 gt 到完成。 . 设置redis密码。 C: Program Files Redis 编辑这个文件: redis.windows service.conf 找到含有requirepass字样的地方,追加一行,输入requir ...
2019-01-29 10:45 0 855 推荐指数:
1、定时器停止 示例: package main import ( "fmt" "time" ) func main() { timer := time.NewTimer(3 * time.Second) go func() { <-timer.C ...
1、方法的重写 示例: //Person类型,实现了一个方法 func (tmp *Person) PrintInfo() { fmt.Printf("name=%s, sex=%c, a ...
1、json解析到结构体 示例: package main import ( "encoding/json" "fmt" ) type IT struct { Company s ...
1、recover的使用 示例: package main import "fmt" func testa() { fmt.Println("aaaaaaaaaaaaaaaaa") } ...
1、字符串转换 示例: package main import ( "fmt" "strconv" ) func main() { //转换为字符串后追加到字节数组 slice ...
[0] = 1 //int i[1] = "hello go" ...
1、WriteString的使用 示例: package main import ( "fmt" "os" ) func WriteFile(path string) { f, e ...
Ticker是一个定时触发的计时器,它会以一个间隔(interval)往channel发送一个事件(当前时间),而channel的接收者可以以固定的时间间隔从channel中读取事件。 1、 ...