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
+14.1k Golang : Get dimension(width and height) of image file
+30.7k Golang : Remove characters from string example
+7.9k Golang : Reverse a string with unicode
+5.6k Golang : If else example and common mistake
+14.6k Golang : Find network of an IP address
+18.9k Golang : Implement getters and setters
+5.3k Python : Create Whois client or function example
+13.2k Golang : Handle or parse date string with Z suffix(RFC3339) example
+14.3k Elastic Search : Mapping date format and sort by date
+6.6k Elasticsearch : Shutdown a local node
+12.3k Golang : calculate elapsed run time
+22.1k Fix "Failed to start php5-fpm.service: Unit php5-fpm.service is masked."