Repository navigation
feat: add "expr_noreflectmethod" build tag - #957
vincentbernat wants to merge 1 commit into
Conversation
f0cb45a to
d0afa56
Compare
|
I have added a commit to make tests work with the tag (and updated one workflow to demonstrate that). |
216d251 to
ec07cc1
Compare
|
Nice. Let me review this pull request and I will merge it and release new version shortly after. |
|
Any news, perhaps? |
|
Currently on my vacation, please @materight take a look |
73c5477 to
4125b41
Compare
|
I have updated this pull request to "fix" tests. In the future, this may be the main hindrance with such a patch: tests using |
|
I think this would be doable by modifying |
|
Thanks! With the build tag set, |
When `reflect.Value.MethodByName()` or `reflect.Value.Method()` are reachable, the Go linker keeps all exported methods of all types. With this tag, expr does not use them and the binary can be smaller. By enabling this tag, two features are removed: - functions in environment - `Eval()` method `Eval()` will return an error if compiled with `expr_noreflectmethod`. This error is also used to auto-skip tests Most tests are auto-skipped if they call `Eval()` to minimize the changes to tests by modifying the `Error()` and `NoError()` helpers. Remaining tests can call `assert.SkipNoReflectMethod()` or set a build tag `!expr_noreflectmethod`. Fix expr-lang#863.
4125b41 to
8171d27
Compare
|
I have updated this PR:
|
By enabling this tag, two features are removed:
Fix #863.
Related to #956.
I still need to work on the tests to make them work with or without the tag.