xgo test ./...
xgo is taking a while to setup, please wait...
? github.com/wechatpay-apiv3/wechatpay-go/cmd/wechatpay_download_certs [no test files]
? github.com/wechatpay-apiv3/wechatpay-go/core/auth [no test files]
? github.com/wechatpay-apiv3/wechatpay-go/core/cipher [no test files]
ok github.com/wechatpay-apiv3/wechatpay-go/core 0.928s
ok github.com/wechatpay-apiv3/wechatpay-go/core/auth/credentials 1.249s
ok github.com/wechatpay-apiv3/wechatpay-go/core/auth/signers 1.442s
? github.com/wechatpay-apiv3/wechatpay-go/core/consts [no test files]
ok github.com/wechatpay-apiv3/wechatpay-go/core/auth/validators 1.692s
? github.com/wechatpay-apiv3/wechatpay-go/core/option [no test files]
? github.com/wechatpay-apiv3/wechatpay-go/services [no test files]
ok github.com/wechatpay-apiv3/wechatpay-go/core/auth/verifiers 2.113s
ok github.com/wechatpay-apiv3/wechatpay-go/core/cipher/ciphers 1.986s
ok github.com/wechatpay-apiv3/wechatpay-go/core/cipher/decryptors 1.686s
ok github.com/wechatpay-apiv3/wechatpay-go/core/cipher/encryptors 1.722s
? github.com/wechatpay-apiv3/wechatpay-go/services/partnerpayments [no test files]
? github.com/wechatpay-apiv3/wechatpay-go/services/payments [no test files]
ok github.com/wechatpay-apiv3/wechatpay-go/core/downloader 12.718s
ok github.com/wechatpay-apiv3/wechatpay-go/core/notify 1.926s
ok github.com/wechatpay-apiv3/wechatpay-go/services/cashcoupons 2.426s [no tests to run]
ok github.com/wechatpay-apiv3/wechatpay-go/services/certificates 3.012s
ok github.com/wechatpay-apiv3/wechatpay-go/services/fileuploader 2.588s [no tests to run]
ok github.com/wechatpay-apiv3/wechatpay-go/services/giftactivity 3.414s [no tests to run]
ok github.com/wechatpay-apiv3/wechatpay-go/services/goldplan 3.594s [no tests to run]
ok github.com/wechatpay-apiv3/wechatpay-go/services/lovefeast 3.796s [no tests to run]
ok github.com/wechatpay-apiv3/wechatpay-go/services/merchantexclusivecoupon 3.298s [no tests to run]
ok github.com/wechatpay-apiv3/wechatpay-go/services/partnerpayments/app 3.556s [no tests to run]
ok github.com/wechatpay-apiv3/wechatpay-go/services/partnerpayments/h5 3.502s [no tests to run]
ok github.com/wechatpay-apiv3/wechatpay-go/services/partnerpayments/jsapi 3.669s [no tests to run]
ok github.com/wechatpay-apiv3/wechatpay-go/services/partnerpayments/native 3.704s [no tests to run]
ok github.com/wechatpay-apiv3/wechatpay-go/services/partnertransferbatch 3.597s [no tests to run]
ok github.com/wechatpay-apiv3/wechatpay-go/services/payments/app 3.425s [no tests to run]
ok github.com/wechatpay-apiv3/wechatpay-go/services/payments/h5 3.589s [no tests to run]
ok github.com/wechatpay-apiv3/wechatpay-go/services/payments/jsapi 3.499s [no tests to run]
ok github.com/wechatpay-apiv3/wechatpay-go/services/payments/native 3.367s [no tests to run]
ok github.com/wechatpay-apiv3/wechatpay-go/services/payrollcard 3.166s [no tests to run]
ok github.com/wechatpay-apiv3/wechatpay-go/services/profitsharing 3.290s [no tests to run]
ok github.com/wechatpay-apiv3/wechatpay-go/services/refunddomestic 3.332s [no tests to run]
ok github.com/wechatpay-apiv3/wechatpay-go/services/retailstore 2.990s [no tests to run]
ok github.com/wechatpay-apiv3/wechatpay-go/services/transferbatch 3.040s [no tests to run]
ok github.com/wechatpay-apiv3/wechatpay-go/services/weixinpayscanandride 2.945s [no tests to run]
ok github.com/wechatpay-apiv3/wechatpay-go/services/wexinpayscoreparking 2.921s [no tests to run]
ok github.com/wechatpay-apiv3/wechatpay-go/utils 3.431s
ok github.com/wechatpay-apiv3/wechatpay-go/utils/task 17.734s
在这个PR中,我使用xgo替换了gomonkey。 xgo相对于gomonkey具有如下优点:
defer patch.Reset()
等代码xgo的项目地址: https://github.com/xhd2015/xgo
使用xgo进行单测的步骤:
windows
powershell -c "irm github.com/xhd2015/xgo/raw/master/install.ps1|iex"
测试结果: