I had finally gotten tired of fighting with Twitter lists and decided it was time to start trimming down my follows so I could actually turn on my Home list without it scrolling my computer into RAM exhaustion.
In recent Go applications I had been putting configuration information in a config.toml file alongside the binary. That had been working, but having to keep track of a configuration file is a pain and counter to The 12 Factor App way of doing things. In this video in particular Francesc uses it to get Twitter authentication information.
Here’s the relevant code snippet:
That gets the important bits out of the way before main() even gets going. It still feels a little awkward to throw a panic at an end-user that doesn’t understand what panic means, but for now that’s working really well.