note
This commit is contained in:
parent
f663a06752
commit
23dba0980b
@ -8,8 +8,8 @@ import (
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
for _, e := range os.Environ() { // `Environ` returns a slice of strings in the form
|
for _, e := range os.Environ() { // `Environ` returns a slice of strings in the form
|
||||||
pair := strings.Split(e, "=") // `KEY=value`.
|
pair := strings.Split(e, "=") // `KEY=value`. You can `strings.Split` them to get
|
||||||
fmt.Println(pair[0])
|
fmt.Println(pair[0]) // the key and value.
|
||||||
}
|
}
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user