[Go实战]怎么写测试类,运用testing.T zld126126 2022-10-14 70 阅读1分钟 1. 命名时一定要有test字眼,例如dong_test.go 2.如下 包名可以是其他,不一定要main package main import ( "testing" ) func TestHelloWorld(t *testing.T) { t.Log("HelloWorld") }