Comments (8)
直接 go test 即可,后面不要加文件
from alipay.
对,直接 go test 后面不要加文件能通过测试,这是什么原因?我在我的程序里用 var p = AliPayTradePagePay{}的时候也是undefined: AliPayTradePagePay
from alipay.
我觉得应该是�和 go path 有关系,建议你多尝试一下
from alipay.
你go test trade_test.go 正常吗?为何go test 正常,而go test trade_test.go报undefined: AliPayTradePagePay?
from alipay.
在某一个包下面执行 go test,默认对象是这个包下的所有源代码文件;如果 go test file.go ,那在 test 的时候就只是针对这一个文件,因为这个项目的test文件和源代码是放在一个包下,所以在 test 文件中并不需要单独的导入相关的包,所以你go test trade_test.go 会报各种undefined, 去好好检查一下你的代码,要么是包引入错误,要么就是go path 设置有问题
from alipay.
我是:
go get github.com/smartwalle/alipay
cd github.com/smartwalle/alipay
go test OK
go test trade_test.go
command-line-arguments
./trade_test.go:22: undefined: AliPayTradeQuery
./trade_test.go:25: undefined: client in client.TradeQuery
./trade_test.go:36: undefined: AliPayTradeAppPay
./trade_test.go:43: undefined: client in client.TradeAppPay
./trade_test.go:49: undefined: AliPayTradePagePay
./trade_test.go:56: undefined: client in client.TradePagePay
也就是在你的源码目录下,无任何我的代码,我别的github.com/xxx/xxx及自己的项目都正常,go path应没问题。请问在你的系统中 go test trade_test.go 没问题吗?
from alipay.
请仔细看我的上一条回复
from alipay.
或者加我qq 917996695
from alipay.
Related Issues (20)
- 验签需要签名,怎么计算生成签名啊 HOT 1
- example里的notify方法何时发起调用啊 HOT 1
- v3.2.15版本计算回调的sign时会对字段里的内容trim导致签名计算和alipay行为不一致 HOT 3
- 签约参数添加sign_notify_url HOT 2
- 电商支付通相关的接口计划 HOT 1
- 自定义请求失败 HOT 4
- App支付接口只有签名,没有下单 HOT 2
- 按照README里面文件上传的示例写,一直提示参数无效呀? HOT 3
- UserCertDocCertVerifyConsult 接口参数缺少auth_token(accesstoken) 传递参数 HOT 4
- 签名验证失败问题 HOT 15
- 添加商家分账接口支持
- 支付宝私钥格式为PKCS#8 ,测试文件中使用了PKCS1格式进行解析导致失败 HOT 1
- 支付宝 SPI 接入三方服务的时候 需要商家验签,这个地方有没有可以参考的例子学习一下?
- 自定义请求方式如何输出请求参数 HOT 1
- SystemOauthToken 接口报错 invalid certificate HOT 10
- alipay.open.mini.baseinfo.modify(小程序修改基础信息) HOT 4
- alipay.user.deloauth.detail.query(查询解除授权明细) 这个api 有吗 HOT 3
- 请问支持直付通吗 HOT 2
- input context support otel HOT 3
- 调用支付宝支付查询接口TradeQuery HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alipay.