This suggests to me that the author is misunderstanding why ‘&’ causes POSIX shells to do weird things.
I think what’s happening is the author tried a web URI that had an ampersand in, Bash then background the process and the author panicked thinking the Go runtime was parsing the ampersand rather than his or her $SHELL.
Yes, this is exactly what happened.
The author says this is one of their first Go projects, which explains their misunderstanding. They still have a lot to learn, not only about Go but Bash as well.
That being said, I am happy to see new programmers learn new things, especially in one of my favourite programming languages.
That experience really made me appreciate just how varied developers experiences were with the command line and also appreciative that people are still writing tools and happy to share them with the community even when they're not 40+ year old UNIX grey beards. It's good to see fresh folk adopt TUIs.
curl -s https://trace.moe/api/search?url=https://foobar/baz.jpg
And in the project the URL is simply appended:
https://github.com/irevenko/what-anime-cli/blob/main/cli/lin...
The API provides both GET and POST methods of passing the image file or URL and the author has somehow mangled them both into one as well :)
As first project though, it's a great learning exercise for the author. We all have to start somewhere.
This looks like just a cute script/program the author wanted to share with HN, I don't think it's a big deal if they didn't fully productionize the thing and just wanted it to be seen.
I don't know Golang, so I can't definitely confirm or deny any intricacies it may or may not have. Though as mentioned by others, it seems to essentially be a wrapper for a webpage
Being blatently vulnerable is not the same thing as being not production ready.
Creating URLs or command line arguments without proper escaping is going to fail in so many ways, even on data that isn't malicious.
>NOTE: MAKE SURE THAT YOUR LINKS ENDS WITH .IMAGE_FORMAT AND DOESN'T HAVE ANY & CHARS AFTER BECAUSE THIS SYMBOL IS RESERVED BY GOLANG
Makes me a bit uncomfortable with it. Shouldn't input sanitization be one of the first things to consider when doing user-facing applications?