java方向学习go
小弟java开发了4年了,最近对go很有兴趣 近期却对go的 指针,地址 搞得头大!!! 一会是 *,一会是& 还有 *& 哎,指针这个玩意到底是好还是不好呢...阅读全文
小弟java开发了4年了,最近对go很有兴趣 近期却对go的 指针,地址 搞得头大!!! 一会是 *,一会是& 还有 *& 哎,指针这个玩意到底是好还是不好呢...阅读全文
想获取 struct 字段中的自定义标签。网上毛线资料没有。算了。自己看手册慢慢搞了 package main import ( "fmt" "reflect" ) type Test struct { Id int `json:"user_id"` Name string "this is name" } func main() { t := Test{Id: 1, Name: "xiaochuan"} r := reflect.TypeOf(t) fmt.Println() fmt.Printf("Id Tag is %s \n", r.Field(0).Tag) fmt.Println() fmt.Printf("Name Tag is %s \n", r.Field(1).Tag) ...阅读全文
这编辑器。。。满大街的不用一...阅读全文
postform 这个玩意里面有个url.value 这个,他里面的东西只支持String,怎么办?我要放一个int进去 他给我报了个cannot use 25423901 (type int) as type string in array or slice literal 代码如下 respDomainRecord,err := http.PostForm("http://dnsapi.cn/Record.List",url.Values{"login_email":{login_email},"login_password":{login_password},"format":{"json"},"domain_id":{25423901}}) if err !=nil{ ...阅读全文