mirror of
https://github.com/Luzifer/korvike.git
synced 2024-12-29 23:51:16 +00:00
16 lines
263 B
Go
16 lines
263 B
Go
package main
|
|
|
|
import "os"
|
|
|
|
func init() {
|
|
registerFunction("env", func(name string, v ...string) string {
|
|
defaultValue := ""
|
|
if len(v) > 0 {
|
|
defaultValue = v[0]
|
|
}
|
|
if value, ok := os.LookupEnv(name); ok {
|
|
return value
|
|
}
|
|
return defaultValue
|
|
})
|
|
}
|