Golang : Get environment variable
Sometimes we need to get the environment variables for performing next task in our program. It is straight forward to do this in Go.
For example, to get the environment variable HOME.
Home := os.Getenv("HOME")
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+11.3k Golang : 2 dimensional array example
+9k Golang : List available AWS regions
+6.5k Golang : Word limiter example
+5.5k Golang : How to get capacity of a slice or array?
+12.9k Golang : Compress and decompress file with compress/flate example
+9.8k Golang : Get currencies exchange rates example
+18.5k Golang : How to get own program name during runtime ?
+5.1k CodeIgniter/PHP : Remove empty lines above RSS or ATOM xml tag
+12.3k Swift : Convert (cast) Int to String ?
+4.4k PHP : See installed compiled-in-modules
+12.7k Golang : Activate web camera and broadcast out base64 encoded images