From ebcadd96c358c65b480574e1ab50f3b6ffe21517 Mon Sep 17 00:00:00 2001 From: Mark McGranaghan Date: Tue, 18 Sep 2012 21:45:44 -0700 Subject: [PATCH] env --- README | 5 ++++- src/xx-env.go | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 src/xx-env.go diff --git a/README b/README index 71ee76e..512b495 100644 --- a/README +++ b/README @@ -61,7 +61,6 @@ gobyexample.com signups * hipache port * templating * ssh -* environment variables * dns * timers * tty @@ -78,6 +77,10 @@ gobyexample.com signups * oauth for google domains * connection pool * typed json parse/unparse + +* deploying to heroku +* shipping a package (structure, github, docs) + * blackfriday = program ideas diff --git a/src/xx-env.go b/src/xx-env.go new file mode 100644 index 0000000..3f23ab2 --- /dev/null +++ b/src/xx-env.go @@ -0,0 +1,17 @@ +package main + +import ("os"; "fmt"; "strings") + +func main() { + for _, e := range os.Environ() { + pair := strings.Split(e, "=") + fmt.Println(pair[0], pair[1]) + } + fmt.Println() + + fmt.Println(os.Getenv("PWD")) + fmt.Println() + + os.Setenv("FOO", "bar") + fmt.Println(os.Getenv("FOO")) +}