Files
mgmt/examples/lang/env1.mcl
James Shubin d1c15bd0b7 lang: funcs: Rename the lookup functions
This will make things more consistent with future use.
2023-10-17 15:21:18 -04:00

14 lines
214 B
Plaintext

import "fmt"
import "sys"
$env = sys.env()
$m = map_lookup_optional($env, "GOPATH", "")
print "print0" {
msg => if sys.hasenv("GOPATH") {
fmt.printf("GOPATH is: %s", $m)
} else {
"GOPATH is missing!"
},
}