pu369com

上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 33 下一页

2020年6月10日

Golang: 解析JSON数据之一

摘要: // 读取JSON文件 将内容转为结构对象 然后更改数据 package main import ( "encoding/json" "fmt" ) type ( person struct { Name string `json:"name"` Age int `json:"age"` } res 阅读全文

posted @ 2020-06-10 17:23 pu369com 阅读(621) 评论(0) 推荐(0)

2020年6月8日

go csv 处理 - 下载股票历史数据

摘要: 感谢网易,历史数据下载(CSV格式) 下面是获取工商银行0601398,从2014年07月20日到2015年05月08日之间的历史数据,文件为CSV格式 http://quotes.money.163.com/service/chddata.html?code=0601398&start=20140 阅读全文

posted @ 2020-06-08 17:16 pu369com 阅读(596) 评论(0) 推荐(0)

2020年6月5日

golang 指针在struct里的应用

摘要: package main import "fmt" type OBJ struct { A string B *int } func main() { var data int = 0 addr := &data obj1 := OBJ{ A: "aaa", B: addr, } obj2 := O 阅读全文

posted @ 2020-06-05 11:30 pu369com 阅读(223) 评论(0) 推荐(0)

2020年6月4日

go 获取沪深A股代码

摘要: package main import ( "fmt" "io" "io/ioutil" "net/http" "regexp" "strconv" "strings" "github.com/PuerkitoBio/goquery" "golang.org/x/text/encoding/simp 阅读全文

posted @ 2020-06-04 19:37 pu369com 阅读(348) 评论(0) 推荐(0)

golang实现unicode码和中文之间的转换

摘要: package main import ( "fmt" "strconv" "strings" ) func main() { sText := "中文" textQuoted := strconv.QuoteToASCII(sText) textUnquoted := textQuoted[1 : 阅读全文

posted @ 2020-06-04 15:54 pu369com 阅读(1270) 评论(0) 推荐(0)

2020年6月3日

Golang 数据可视化利器 go-echarts 开源啦

摘要: 目标:在浏览器中显示 柱状图 原文中漂亮的代码在图片中,无法复制,自己动手写吧,代码: package main import ( "net/http" "os" "github.com/go-echarts/go-echarts/charts" ) func main() { http.Handl 阅读全文

posted @ 2020-06-03 18:17 pu369com 阅读(1714) 评论(0) 推荐(0)

golang 生成二维码海报的实现代码

摘要: 目标:生成一个二维码,加上 logo,扫码结果为baidu.com 准备工作,准备一个logo,我是借用了CSDN的logo,保存为 avatar.png,置于main.go代码同目录下 main.go代码: package main import ( "errors" "fmt" "image" 阅读全文

posted @ 2020-06-03 13:34 pu369com 阅读(1450) 评论(0) 推荐(0)

2020年5月27日

Golang 爬虫系列一 goquery

摘要: 主要参考原文在https://www.jianshu.com/p/ae172d60c431 主要想练习一下goquery,首先是实践一把 使用goquery爬取豆瓣电影top250 从原文最后复制代码,编译运行。输入一堆err 调试了一下,返回Http错误代码418,应该是反爬虫了。 好吧,我们不应 阅读全文

posted @ 2020-05-27 17:25 pu369com 阅读(566) 评论(0) 推荐(0)

2020年5月21日

PowerShell使用教程

摘要: 1、打开powershell 不说了 2、 获取帮助: get-help (所有命令都是cmdlet格式,help也不例外) 3、查看有哪些命令: get-command (可看到命令类型有:Alias别名、Cmdlet命令、Function函数) 4、查看以 get开头的命令: get-comma 阅读全文

posted @ 2020-05-21 19:42 pu369com 阅读(691) 评论(0) 推荐(0)

Go 语言显示下载文件进度/分段读取 io.TeeReader()

摘要: 想用go下载文件,代码: package main import ( "fmt" "io" "net/http" "os" "strings" ) // WriteCounter counts the number of bytes written to it. It implements to t 阅读全文

posted @ 2020-05-21 18:03 pu369com 阅读(921) 评论(0) 推荐(0)

上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 33 下一页

导航