摘要:
一个简单的web服务器 简单看下Request结构体中几个重要成员 获取get参数 获取post参数 提交方式: application/x www form urlencoded 提交方式: json go type RequestParm struct { Name string Age int 阅读全文
posted @ 2018-08-12 14:37
Sawyer Ford
阅读(576)评论(0)推荐(0)
摘要:
reflect,反射。 利用reflect,可以得到一个struct的相关信息。 输出如下: hello atom, my name is xiaominghello jack, my name is xiaoming Type: UserFields: Id: int = 1 Name: stri 阅读全文
posted @ 2018-03-14 19:24
Sawyer Ford
阅读(402)评论(0)推荐(0)
摘要:
golang使用array表示固定大小的数组,使用slice表示动态数组。 输出如下: type of array: [5]intaddress of array: 0xc420014150address of arrar[0]: 0xc420014150slice = [2 3 5 7 11], 阅读全文
posted @ 2017-12-03 16:48
Sawyer Ford
阅读(330)评论(0)推荐(0)
摘要:
method Go does not have classes. However, you can define methods on types. 输出如下: 5101020 三个注意点: 1. Methods with pointer receivers can modify the value 阅读全文
posted @ 2017-11-24 15:11
Sawyer Ford
阅读(260)评论(0)推荐(0)