我想使用 gomock 进行 go 示例测试,我该怎么做?
func Example_getCorrectForm(){
ctrl := gomock.NewController(t) <----------- How to get this *testing.T
defer ctrl.finish()
// use ctrl and mock some services and use them
fmt.Println(<output stringified json >)
//Output:
//<my expected stringified json output goes here>
}
如何通过 gomock 使用 Go 可测试示例
你根本做不到。