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
+7.1k Your page has meta tags in the body instead of the head
+25.3k PHP : Convert(cast) string to bigInt
+8k Golang : Play .WAV file from command line
+14.8k Golang : Find out mime type from bytes in buffer
+16k Golang : delete and modify XML file content
+18.2k Golang : Close channel after ticker stopped example
+13.5k Golang : Adding XML attributes to xml data or use attribute to differentiate a common tag name
+4.9k Facebook : How to force facebook to scrape latest URL link data?
+7.7k Golang : Write multiple lines or divide string into multiple lines
+6.4k Golang : How to convert strange string to JSON with json.MarshalIndent
+13k Golang : Reset buffer example