6 ms·
Basic project template for golang, slightly opinionated
- marcus_holmes 10y agoreally? Three (known) dependencies before I even start? Plus Python? The wonderful thing I'm loving about Golang is that I can reduce dependencies. Put the ones I need in a vendor directory. Edit those files to remove their dependencies for edge cases I don't need in my project. Less is more!
- shanemhansen 10y agoI noticed they default to creating a main function that runs os.Exit(0). I recommend not doing that because it stops any potential deferred actions from running. It's not required for their simple main() func to run correctly, but I feel it's a good habit to get into.
- lacion 10y agothanks for the comment, i just made some changes to reflect that.
- chank 10y agoNeeding python to create a golang project template...
- mwpmaybe 10y ago"S/he wrote his own command-line utility to create projects from templates? Why didn't s/he just use cookiecutter?"
- geoah 10y agoS/he is already using github.com/audreyr/cookiecutter -- you didn't even open the repo did you? :P
- VonGallifrey 10y agoI think you missed the sarcasm. I interprete the comment that it was meant to highlight that someone would complain about not using cookiecutter in exactly the same way someone is complaining that the project is using cookiecutter. Said in another way: You can never make something that everyone likes. Someone will complain.
- chank 10y agoThe main comment was in the context of using python, not using cookiecutter. Golang has a built in template engine. Why not build your golang command line tool to build golang project seeds in golang?
- alex95 10y ago"Slightly opinionated" - What does this even mean? That you wrote something with your own style? I don't get all this hipster talk nowadays...
- karmacoda 10y agoI can't even begin to grasp how this is HN front page. No offence, but in the world of tech is this really in the top 30 most interesting things?
- lacion 10y agothe project has now been updated and is now a lot less opinionated except for a few things.