Our great sponsors
-
I usually have my main function be very scriptlike, with all the setup code, env vars and such in the beginning, and then starting whatever needs to be started. I think that's fine. See an example from some of my code here: https://github.com/golangdk/canvas/blob/newsletter-email/cmd/server/main.go
-
I tend to use packages like viper (https://github.com/spf13/viper) to handle configuration at a global level. If you want to do it yourself, you can write a singleton to store your configurations. On the internet there are many examples about writing a singleton in Go.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.