草庐IT

testMain

全部标签

google-app-engine - 如何将 TestMain 与全局 aetest.NewInstance 一起使用

我正在使用“google.golang.org/appengine/aetest”像这样打包和设置我的TestMain:varmyAeInstaetest.InstancefuncTestMain(m*testing.M){varerrerrormyAeInst,err=aetest.NewInstance(&aetest.Options{StronglyConsistentDatastore:true})defertearDown()c:=m.Run()os.Exit(code)}functearDown(){ifmyAeInst!=nil{myAeInst.Close()}}但是一
12