![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
go
touch_ping
欢迎访问我的github:https://github.com/qq179157977
展开
-
go 语言解析复杂json
// Click here and start typing.package mainimport "fmt"import "encoding/json"type MxRecords struct { Value string Ttl int Priority int HostName string}type Data struct { MxRecord转载 2015-01-08 16:39:12 · 3683 阅读 · 0 评论 -
go代理服务器代码
go代理服务器代码最近用废弃的小笔记本搭了个centos服务器挂着,搭了ssh,tomcat,go环境,想搭个代理服务器访问路由,不想安装,想自己写一个,顺便复习一下go语言知识。一开始,我网上搜了一下go语言写代理服务器的代理,搜索到一个: 来自:http://symphony.b3log.org/article/1357452978419 (原文地址:http://kejibo.com/go原创 2015-07-23 00:33:00 · 1745 阅读 · 0 评论 -
3.6学习内容,androidwifiP2p,golang http.ListenAndServe运行机制,
android p2p两篇文章:http://blog.csdn.net/gophers/article/details/38060307http://blog.csdn.net/max2005/article/details/12237905官方文档:http://developer.android.com/training/connect-devices-wirelessl转载 2015-03-06 23:36:31 · 914 阅读 · 0 评论 -
2.12学习内容 go的map、闭包,andoid的Fragment相关
package mainimport "fmt"type Vertex struct { Lat, Long float64}var m map[string]Vertexfunc main() { m = make(map[string]Vertex) m["Bell Labs"] = Vertex{ 40.68433, -74.39967, } fmt.Prin转载 2015-02-12 22:28:37 · 627 阅读 · 0 评论 -
intellij idea13.1.4b配置go开发环境
首先下载intellijdea13.1.4b(建议大家使用14,因为13.1.14a版本有bug,容易下错)http://pan.baidu.com/s/1i3kns5B再去下载go1.2http://www.golangtc.com/download最后下载intellijIDEA的go插件:http://plugins.jetbrains.com/plugi原创 2015-01-04 22:26:00 · 1624 阅读 · 0 评论 -
golang错误link reading body gob: attempt to decode into a non-pointer
出错代码:err = client.Call("Math.Add",args,rep)出错原因:链接采用非指针,解决方法:改成指针 err = client.Call("Math.Add",&args,&rep)原创 2015-01-15 09:47:18 · 3087 阅读 · 0 评论 -
go语言rune法substring出错问题
网上一个substring的方法:func SubString(str string,begin,length int) (substr string) { // 将字符串的转换成[]rune rs := []rune(str) lth := len(rs) // 简单的越界判断 if begin < 0 { begin = 0 } if begin >= lth {原创 2015-01-11 23:24:50 · 1316 阅读 · 0 评论 -
golang解决cannot convert a (type interface {}) to type *: need type assertion
cannot convert a (type interface {}) to type string: need type assertioncannot convert a (type interface {}) to type *: need type assertion解决方案:var a interface{} = int(10)var b MyInt原创 2015-01-10 21:23:50 · 17694 阅读 · 0 评论 -
golang查询数据后,获取内容出错问题
err = rows.Scan(&user.Id,&user.Name)if err != nil {fmt.Println(err)}fmt.Println("content:", user)查询时出错:sql: expected 21 destination arguments in Scan, not 2出现原因:数据库不只两个字段,而你只获取2个字段原创 2015-01-11 00:46:36 · 17657 阅读 · 0 评论 -
9.5android线程优先级,go和rust比较
线程优先级设置: http://droidyue.com/blog/2015/09/05/android-process-and-thread-schedule-nice/ linux的优先级设置:sudo renice -n 0 -p 24161android优先级设置: Android中的线程优先级别目前规定了如下,了解了进程优先级与nice值的关系,那么线程优先级与值之间的关系也就更加容原创 2015-09-05 22:44:17 · 1489 阅读 · 0 评论