You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similarly to #319 (comment) I'd like to be able to use the "times" module from the stdlib but I don't want to allow script authors to call times.sleep and block the goroutine that is running the script for an arbitrarily long time. At the moment, the only way to do this that I can see is to copy/paste the contents of times.go to my own package and delete the sleep function from the file and module map, and then add that module instead of the stdlib one. Obviously this isn't a great solution.
I think it would be useful to allow removing specific attributes (e.g. functions) from a built in module via the ModuleMap e.g. by changing the .Remove(name string) method to be .Remove(name string, attrNames ...string). This would be a non-breaking change to the API due to the use of variadic args for the attrNames.
The text was updated successfully, but these errors were encountered:
Similarly to #319 (comment) I'd like to be able to use the "times" module from the stdlib but I don't want to allow script authors to call
times.sleep
and block the goroutine that is running the script for an arbitrarily long time. At the moment, the only way to do this that I can see is to copy/paste the contents oftimes.go
to my own package and delete the sleep function from the file and module map, and then add that module instead of the stdlib one. Obviously this isn't a great solution.I think it would be useful to allow removing specific attributes (e.g. functions) from a built in module via the
ModuleMap
e.g. by changing the.Remove(name string)
method to be.Remove(name string, attrNames ...string)
. This would be a non-breaking change to the API due to the use of variadic args for theattrNames
.The text was updated successfully, but these errors were encountered: