Compare commits

...

1 Commits

Author SHA1 Message Date
Christian Schwarz 348ecde574 envconst dump command (untested)
refs #186
2020-02-17 18:13:26 +01:00
+10
View File
@@ -9,6 +9,16 @@ import (
var cache sync.Map
// capture the actual envconst values used at runtime
func DebugDump() map[string]interface{} {
m := make(map[string]interface{})
cache.Range(func(k, v interface{}) bool {
m[k.(string)] = v
return true
})
return m
}
func Duration(varname string, def time.Duration) time.Duration {
if v, ok := cache.Load(varname); ok {
return v.(time.Duration)