![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
GO
jjxuhuade
这个作者很懒,什么都没留下…
展开
-
go-sql-driver/mysql中Scan结果集转自动换成map解决方案
package main import ( "database/sql" "fmt" "github.com/go-sql-driver/mysql" "log" "time" ) var db *sql.DB func initDb() { var err error config := mysql.Config{ User: "root", Passwd: "", .原创 2020-12-20 02:45:45 · 1245 阅读 · 1 评论 -
go续断器time.NewTicker的Stop方法的正确使用
package main import ( "fmt" "time" ) func main(){ tricker := time.NewTicker(time.Second) syncChan:= make(chan struct{},2) dataChan:=make(chan string ,10) stop:=make(chan bool,1) go func(){ defer close(dataChan) loop: for{ select{ cas.原创 2020-11-29 23:06:24 · 801 阅读 · 0 评论