Skip to content

Instantly share code, notes, and snippets.

@zeddee
Created December 30, 2017 22:05
Show Gist options
  • Save zeddee/e1732c5c2e004aa1d70f0d0b85129e3b to your computer and use it in GitHub Desktop.
Save zeddee/e1732c5c2e004aa1d70f0d0b85129e3b to your computer and use it in GitHub Desktop.
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