随笔分类 - golang
摘要:一个简单的web服务器 简单看下Request结构体中几个重要成员 获取get参数 获取post参数 提交方式: application/x www form urlencoded 提交方式: json go type RequestParm struct { Name string Age int
阅读全文
摘要:reflect,反射。 利用reflect,可以得到一个struct的相关信息。 输出如下: hello atom, my name is xiaominghello jack, my name is xiaoming Type: UserFields: Id: int = 1 Name: stri
阅读全文
摘要:Buffered Channels 如果操作一个空的channel会怎么样呢? 12fatal error: all goroutines are asleep - deadlock! 如果make函数不指定buffer length,会怎么样呢? fatal error: all goroutin
阅读全文
摘要:golang使用array表示固定大小的数组,使用slice表示动态数组。 输出如下: type of array: [5]intaddress of array: 0xc420014150address of arrar[0]: 0xc420014150slice = [2 3 5 7 11],
阅读全文
摘要:method Go does not have classes. However, you can define methods on types. 输出如下: 5101020 三个注意点: 1. Methods with pointer receivers can modify the value
阅读全文
摘要:A Tour of Go Go编程基础 Go 语言圣经 中文版
阅读全文

浙公网安备 33010602011771号