摘要:
2020.12.30 问题总结 中间件 context.Next() 源码注释: // Next should be used only inside middleware. // It executes the pending handlers in the chain inside the ca 阅读全文
摘要:
Go 应用测试 测试的覆盖率 命令: go test ./ -v -cover 在《Go Web 编程》一书中,有以下结论: 这并不是绝对的,测试文件可以在不同的包,进行测试也是不会出现问题的。 但是这样的说法引起了我的兴趣。 果然,执行测试的时候添加参数-cover的时候,如果不在同一个包,将会输 阅读全文
摘要:
Go-序列化给字段起别名(field tag must be a string) type Student struct { Name string `json:"name"` // 是 ` ` (tab键上的~按键) ,不是 ' ' Sex string `json:"sex"` Age int 阅读全文