-
-
Notifications
You must be signed in to change notification settings - Fork 319
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
Suggestion: ./go-script -c 'script.Stdin()...'
tool for running these
#183
Comments
./go-script -c 'script...'
tool for running these
./go-script -c 'script...'
tool for running these./go-script -c 'script.Stdin()...'
tool for running these
Fun follow-up idea: https://fedi.simonwillison.net/@simon/110922873440211227
|
Super nice, thanks @simonw! I'll have a play with this. |
@simonw have you seen https://github.com/erning/gorun ? |
Was just going to suggest something similar but in the form of a hash bang in the go file used as a script ....
|
https://github.com/erning/gorun looks like exactly what I was looking for |
I built a little Bash script to let you do this: https://til.simonwillison.net/bash/go-script
It supports this too:
cat file.txt | ./goscript.sh top10.goscript
And this, saved as
top10.goscript
and made executable:Then run like this:
cat file.txt | ./top10.goscript
It's a fun little hack in Bash, but maybe something like this could be useful as an actual Go program distributed as part of this project.
The text was updated successfully, but these errors were encountered: