![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Go
文章平均质量分 82
Thread刚
这个作者很懒,什么都没留下…
展开
-
Golang正确停止Ticker
Golang可以利用time包的Ticker实现定时器的作用,最近使用Ticker时,发现调用Ticker的Stop方法无法正确的停止Ticker,协程会阻塞在等待Ticker的C通道处,精简后的代码如下:func UseTickerWrong() *time.Ticker {ticker := time.NewTicker(5 * time.Second)go func(ticker *time.Ticker) {for range ticker.C {fmt.Println(“Ticker1…原创 2020-12-22 11:06:40 · 681 阅读 · 0 评论 -
etcd undefined: resolver.BuildOption
使用ETCD clientv3包,遇到以下错误.使用了go mod首先初始化 go mod init接着go build 出现下面问题github.com/coreos/etcd/clientv3/balancer/resolver/endpoint..\..\..\..\pkg\mod\github.com\coreos\etcd@v3.3.18+incompatible\c...原创 2020-03-10 13:33:50 · 2158 阅读 · 4 评论 -
VS code 编辑器配置GO开发环境
方法一:使用git下载源代码再安装我们可以手动从github上下载工具,(执行此步骤前提需要你的电脑上已经安装了git)第一步:现在自己的GOPATH的src目录下创建golang.org/x目录第二步:在终端/cmd中cd到GOPATH/src/golang.org/x目录下第三步:执行git clone https://github.com/golang/tools.git t...转载 2019-12-09 20:39:08 · 249 阅读 · 0 评论 -
go实现定期发送邮件
1.首先安装依赖包安装依赖包:go get github.com/go-gomail/gomailgo get github.com/tealeg/xlsx2.创建main.gopackage mainimport ( "testing" "time" "github.com/tealeg/xlsx" //插件 "log" "fmt...原创 2019-12-01 15:36:31 · 823 阅读 · 0 评论 -
Golang出现的奇怪的问题
编译时C:\Go\pkg\tool\windows_amd64\link.exe: cannot open file C:\Go\pkg\windows_amd64/github.com/boltdb/bolt.a: open C:\Go\pkg\windows_amd64/github.com/boltdb/bolt.a: The system cannot find the file sp...原创 2019-11-26 22:17:48 · 841 阅读 · 0 评论 -
Linux 下安装Go
我的配置VPS:VirMach $1.25一个月的VPS 系统:Ubuntu Server 16.04 LTS 64bit Minimal 可以自己创建个虚拟机安装一个Server版的Linux,或者在这里选一个共享主机登录LinuxMac或Linux的用户可以用命令ssh root@xxx.xxx.xxx.xxx登录主机Window的用户可以使用SecureCRT登录主机虚拟机...转载 2019-09-29 20:46:31 · 114 阅读 · 0 评论