我正在尝试重复golang 测试中的示例
package main
import (
"testing"
)
func TestSomeTest(t *testing.T) {}
func TestMain(m *testing.M) { // cleaning after each test}
我希望TestMain函数在每次测试后运行。
运行命令 go test
编译器说
./testingM_test.go:9: undefined: testing.M
那么每次测试执行后如何清理呢?
ibeautiful
繁华开满天机
随时随地看视频慕课网APP
相关分类