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
+10.5k Swift : Convert (cast) String to Integer
+6.1k Golang : Missing Subversion command
+33.1k Delete a directory in Go
+17.7k Golang : Upload/Receive file progress indicator
+25.4k Golang : Convert long hexadecimal with strconv.ParseUint example
+29.2k Golang : missing Git command
+20.6k Nginx + FastCGI + Go Setup.
+10.4k Golang : cannot assign type int to value (type uint8) in range error
+5.8k Linux : Disable and enable IPv4 forwarding
+13.4k Golang : error parsing regexp: invalid or unsupported Perl syntax
+7.8k Golang : Scan files for certain pattern and rename part of the files