名称规范
算不上规范。
是我使用 Goland生成 test func的时候的自动命令规则,所以记录一下。
为某个函数编写测试方法:
func Foo() error
func TestFoo(t *testing.T) {
}
为某个struct的方法测试:
type Client struct {}
func (c *Client) Foo() error
func TestClient_Foo(t *testing.T) {
}
算不上规范。
是我使用 Goland生成 test func的时候的自动命令规则,所以记录一下。
为某个函数编写测试方法:
func Foo() error
func TestFoo(t *testing.T) {
}
为某个struct的方法测试:
type Client struct {}
func (c *Client) Foo() error
func TestClient_Foo(t *testing.T) {
}