![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
go语言
yypnathan
这个作者很懒,什么都没留下…
展开
-
golang json array转码
例如对于byt := []byte(`{"num":6.13,"strs":["a","b"]}`)对该json转码时,注意对json array的断言方式:var dat map[string]interface{}if err := json.Unmarshal(byt, &dat); err != nil { panic(err) }fmt.Pri原创 2016-05-24 21:33:10 · 1195 阅读 · 0 评论 -
go语言exec包调用shell命令
工程中需要用到ffmpeg,想直接用exec包调用shell命令。本来以为很简单,结果折腾了一下午,最后查到了解决方案。假如之前执行报错的语句为:cmd := exec.Command("echo", "'helloworld!'")out, err := cmd.Output()那么改为:c := "echo hello world"cmd := exec.Comma原创 2016-05-23 22:04:15 · 5951 阅读 · 1 评论