Created
December 30, 2017 22:05
-
-
Save zeddee/e1732c5c2e004aa1d70f0d0b85129e3b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
) | |
func main() { | |
for x, env := range os.Environ() { | |
fmt.Println(x, env) | |
} | |
// Example | |
// Getting the USER and PATH env variables | |
fmt.Println(os.Getenv("USER"),os.Getenv("PATH")) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment