![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
golang
Digital2Slave
图像处理算法,机器学习,深度学习及其应用。
展开
-
Golang 在图像中绘制矩形框
golang 在图像中绘制矩形框,并添加标注信息。原创 2022-07-20 11:08:37 · 884 阅读 · 0 评论 -
Golang JSON包含Slice字符串解析
包含Slice类型的JSON字符串解析。原创 2022-07-20 10:54:26 · 371 阅读 · 0 评论 -
Golang 判断当前时间为当天范围内时间
利用Golang中的time库实现当前时间是否为当天范围内时间的判断。package mainimport ( "fmt" "time")func main() { // format := "2006-01-02 15:04:05" t := time.Now() t_zero := time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, t.Location()) h, _ := time.ParseDuration("+24h")原创 2021-03-24 11:37:52 · 8162 阅读 · 0 评论 -
golang simplejson 学习
golang simplejson 学习1 源码2 输出3 参考1 源码package mainimport ( "encoding/json" "fmt" "reflect" "strconv" simplejson "github.com/bitly/go-simplejson")var jsonStr = `{ "msg" : "Success", "res...原创 2020-01-07 16:51:02 · 1800 阅读 · 0 评论 -
golang -- ioDecReader redeclared in this block
1 问题利用 govendor 来管理基于 gin 的golang web项目,我在用govendor remove移除不必要golang第三方库后,在项目根目录下运行go run main.go出现类似以下错误:ioDecReader redeclared in this block2 解决方法在项目根目录内运行以下命令修复:govendor sync3 参考govendor...原创 2019-08-07 15:08:58 · 531 阅读 · 0 评论 -
在Golang中如何用scrypt对敏感信息加密
0 依赖库mkdir -p $GOPATH/src/golang.org/x/cd $GOPATH/src/golang.org/x/git clone https://github.com/golang/crypto.git1 源码package mainimport ( "crypto/rand" "fmt" "golang.org/x/crypto/scrypt" "...原创 2019-04-04 14:29:58 · 3153 阅读 · 0 评论 -
Golang iota
Codespackage mainimport "fmt"type color byteconst ( black color = iota red blue)func test(c color) { fmt.Println(c)}func main() { const ( x = iota // 0 ...原创 2018-08-02 15:15:12 · 1633 阅读 · 0 评论 -
Golang go-simplejson
Source codego-simplejsona Go package to interact with arbitrary JSON.Installgo get -u github.com/bitly/go-simplejsonImportimport "github.com/bitly/go-simplejson"Demopackage mainimp...原创 2018-03-26 14:38:46 · 2706 阅读 · 0 评论 -
Go convert string to time
本文主要以代码实例的形式,说明了Golang语言中,time对象和string对象之间的转换。源码package mainimport ( "fmt" "reflect" "time")func main() { fmt.Println("--------------=-当前时间/时间戳/字符串-------=--------") t := time.Now(原创 2017-07-07 09:24:23 · 11920 阅读 · 0 评论 -
Golang JSON Unmarshal MySQL datetime to time.Time
json.Unmarshal uses RFC3339 to decode MySQL datetime type into time.Time.Json snippetRight"Datetime": "2017-07-06T17:27:00Z"Wrong"Datetime": "2017-07-06 17:27:00"or"Datetime": "2017-07-06T17:27:00"Refe原创 2017-07-06 18:41:57 · 2516 阅读 · 0 评论 -
gopl-Exercise1.7-9: Fetch
本文主要完成The Golang Programming Language中,1.7-9的练习。源码fetch.go// Copyright © 2016 Alan A. A. Donovan & Brian W. Kernighan.// License: https://creativecommons.org/licenses/by-nc-sa/4.0/// See page 16.//!+原创 2017-07-01 10:57:45 · 844 阅读 · 0 评论 -
gopl-Exercise1.5: Animated GIFs
本文主要用来记录Golang学习中,Animated GIFs的小节作业。源码// Copyright © 2016 Alan A. A. Donovan & Brian W. Kernighan.// License: https://creativecommons.org/licenses/by-nc-sa/4.0/// Run with "web" command-line argument原创 2017-06-30 17:46:39 · 880 阅读 · 2 评论 -
go-tour (1)
在强哥的推荐下,这周利用业余时间看了一些go的tour教程,还没有看完。目前,个人整体感觉go的这个tour教程写的真心不错哦,go语言的语法要不要太简洁哈。我把go-tour教程web版本的文字说明和相应的代码进行了规整,方便以后查阅。顺便说一下,go语言圣经也真心不错哦,抽空再系统学习下。英文原版 亚马逊购买通道中文翻译gitbook1 欢迎 安装离线版本 + Go + $ g原创 2016-10-26 21:27:56 · 2541 阅读 · 0 评论 -
go-tour (2)
继go-tour (1)之后,整理go-tour教程中,有关go语言的方法、接口和并行。3 方法和接口3.1 方法Go没有类。不过你可以为结构体类型定义方法。 方法就是一类带特殊的 接收者 参数的函数。 方法接收者在它自己的参数列表内,位于 func 关键字和方法名之间。 在此例中, Abs 方法拥有一个名为 v ,类型为 Vertex 的接收者。methods.gopackage mai原创 2016-11-06 17:18:31 · 2401 阅读 · 0 评论