摘要: 名称规范 算不上规范。 是我使用 Goland生成 test func的时候的自动命令规则,所以记录一下。 为某个函数编写测试方法: func Foo() error func TestFoo(t *testing.T) { } 为某个struct的方法测试: type Client struct 阅读全文
posted @ 2023-11-12 17:00 潜行1 阅读(14) 评论(0) 推荐(0)
摘要: 今天在使用标准库 ioutil时发现已经过时,是通过在注释上添加实现的。 例如: // WsHandlerFunc is like HandleFunc in Gin. // // Deprecated: Not support. type WsHandlerFunc func(*websocket 阅读全文
posted @ 2023-11-12 16:12 潜行1 阅读(168) 评论(0) 推荐(0)