Skip to content

Instantly share code, notes, and snippets.

@hyuki
Created April 10, 2018 03:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hyuki/f4f31658904baa23d3f10cca74453579 to your computer and use it in GitHub Desktop.
Save hyuki/f4f31658904baa23d3f10cca74453579 to your computer and use it in GitHub Desktop.
環境変数の値を得る
package main
import (
"fmt"
"os"
)
func main() {
fmt.Printf("SALT=%s\n", os.Getenv("SALT"))
}
@hyuki
Copy link
Author

hyuki commented Apr 10, 2018

$ SALT=12345 go run a.go
SALT=12345

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment