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
+26.6k Golang : Change a file last modified date and time
+7.6k Golang : Sort lines of text example
+15.4k Golang : File path independent of Operating System
+10k Golang : Concatenate (combine) buffer data example
+15.9k Golang : Get future or past hours, minutes or seconds
+13.8k Golang : Basic authentication with .htpasswd file
+5.5k Golang : Calculate diameter, circumference, area, sphere surface and volume
+4.6k PHP : Convert CSV to JSON with YQL example
+9.6k Golang : Get currencies exchange rates example
+9.2k Android Studio : Checkbox for user to select options example
+36k Golang : Read a text file and replace certain words
+34k Golang : How to split or chunking a file to smaller pieces?