golang
嘟嘟忍者
这个作者很懒,什么都没留下…
展开
-
user.go
package modelstype User struct {UserId string `json:"username" db:"id"`Username string `json:"username"`Password string `form:"password" json:"password"`Account string `form:"account" js原创 2016-11-11 14:34:02 · 2843 阅读 · 0 评论 -
golang post 传参
如果某个属性是String 类型,data数据块中需要传字符串类型,不能传整型。原创 2016-11-11 10:32:57 · 1976 阅读 · 0 评论 -
golang := 操作符 疑惑
:= 操作符通常:函数体内使用 := 重复声明同名变量,是不允许的: ``疑惑:但是今天发现一段代码,如下这样重复声明变量,却编译通过并成功执行: ``代码:var x intfunc Test_var(t *testing.T) { fmt.Println(x, &x) x = 1 fmt.Println(x, &x) var x i原创 2017-08-24 10:44:37 · 379 阅读 · 0 评论 -
Golang json字符串校验
golang json字符串有效性校验github代码地址import "github.com/ChengjinWu/gojson"func Test_Validator(t *testing.T) { data := `{"id":524042,"name":"酷旅-mob-otv-2","male":true,"other":null}` err := gojso原创 2018-11-12 18:54:47 · 4597 阅读 · 1 评论 -
golang json字符串转Golang对象
golang json字符串转Golang对象github代码地址一、普通json字符串转Golang对象import "github.com/ChengjinWu/gojson"func Test_json(t *testing.T) { data := `{"id":524042,"name":"酷旅-mob-otv-2","male":true,"other"原创 2018-11-12 19:05:56 · 7062 阅读 · 0 评论 -
Golang json字符串转Golang代码以及get、set方法
Golang json字符串转Golang代码GitHub源代码地址json字符串转Golang代码以及get、set方法import "github.com/ChengjinWu/gojson"func Test_json_array111(t *testing.T) { data := `{ "id": [ -524042.5, 23123144444555...原创 2018-11-12 19:08:11 · 1933 阅读 · 0 评论 -
进阶问题
1. 用户态和内核态是什么?区别在哪?2. nginx为什么如此高效?为什么http服务不采用nginx同样的策略?3. 一次完整的http请求的完整过程是什么?七层协议每层做了什么?4. b+数据索引了解 ...原创 2019-01-16 18:02:35 · 384 阅读 · 0 评论