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
+7k Web : How to see your website from different countries?
+5.9k Golang : Detect variable or constant type
+12.1k Golang : Perform sanity checks on filename example
+17.7k Golang : Upload/Receive file progress indicator
+81.1k Golang : How to return HTTP status code?
+9.2k Golang : does not implement flag.Value (missing Set method)
+8.3k Golang : Check if integer is power of four example
+11.6k Swift : Convert (cast) Float to String
+7.3k Ubuntu : connect() to unix:/var/run/php5-fpm.sock failed (13: Permission denied) while connecting to upstream
+5.3k JavaScript/JQuery : Redirect page examples
+15.4k Golang : Get all local users and print out their home directory, description and group id
+6k Linux/MacOSX : Search for files by filename and extension with find command