We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I see a number of modules defined in https://github.com/google/starlark-go/tree/master/starlark/testdata, But I am not sure how to use those modules, I'm primarily looking for the math module.
Similarly, I see another math module in the starlark-go code: https://github.com/google/starlark-go/tree/master/lib/math Again, I couldn't find any documentation how to use it.
It would be also be nice, to have at least one example on how to use starlarkstruct.Module to define a new module and use them as well.
The text was updated successfully, but these errors were encountered:
I found how to use the modules defined in go using starlarkstruct.Module.
starlarkstruct.Module
For example: To use the math module defined in https://github.com/google/starlark-go/tree/master/lib/math just add it to the globals.
globals := starlark.StringDict{ "math": math.Module, }
Then, in the starlark code, you can simply use,
print(math.ceil(3.5))
Sorry, something went wrong.
No branches or pull requests
I see a number of modules defined in https://github.com/google/starlark-go/tree/master/starlark/testdata,
But I am not sure how to use those modules, I'm primarily looking for the math module.
Similarly, I see another math module in the starlark-go code: https://github.com/google/starlark-go/tree/master/lib/math
Again, I couldn't find any documentation how to use it.
It would be also be nice, to have at least one example on how to use starlarkstruct.Module to define a new module and use them as well.
The text was updated successfully, but these errors were encountered: