-
Notifications
You must be signed in to change notification settings - Fork 546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
qexp: add export const and vars #373
Conversation
Codecov Report
@@ Coverage Diff @@
## master #373 +/- ##
==========================================
+ Coverage 86.81% 87.32% +0.51%
==========================================
Files 36 36
Lines 9063 9136 +73
==========================================
+ Hits 7868 7978 +110
+ Misses 931 896 -35
+ Partials 264 262 -2
Continue to review full report at Codecov.
|
加新功能和该bug最好不要一个pr里面 |
已修改提交为只完成 const 导出 |
使用 rebase 重新提交。 |
cmd/qexp/gopkg/exporter.go
Outdated
exportFns []exportedFunc | ||
exportFnvs []exportedFunc | ||
exportConsts []exportedConst | ||
hasReflectPkg bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我倾向于我们主动 import 的 package 只有 github.com/qiniu/goplus/gop
,如果这里面缺的,就加。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
收到,准备改成动态添加。
在另一个 qexport 项目中,我使用的是 golang.org/x/tools/imports 库在格式化时自动增删 imports ,但要引入格外的 mod pkg 。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修复,目前加入 TestExportStd 测试以提高覆盖率,利用代码格式化方式校验导出库是否存在语法错误。
对 ConstUnboundInt 做检查,所以在 math 库中会出现 int64 和 uint64 转换。
(因为可能使用 gopherjs 32bit 编译,所以保留了 int64 转换)