Jump to Content

Andrew M McCall

Go Application Configuration

Golang Read Environment Variables From File: How To Do It [Code Snippets]

What Are Environmental Variables In Go A Cautionary Tale: My AWS Account Was Hacked And I Have A $50,000 Bill If you have ever used an API key or database connection string, you have most likely had a need to secure some sensitive data. Environment variables are a way to achieve this. We may need to do this because certain API’s can only be called so many times and the key is a way of authorizing our requests and keeping track of them.