直接输入 go test 不会打印t.Log记录的信息,
所以查看文档,发现需要 -v 参数。
go test -v 成功也会打印 t.Log 和 t.Logf的记录
Verbose output: log all tests as they are run. Also print all
text from Log and Logf calls even if the test succeeds.
1,测试单个文件,一定要带上被测试的原文件(如果包含多个文件需要添加多个)
Go test -v wechat_test.go wechat.go
2,测试单个方法
go test -v -test.run TestRefreshAccessToken