From 348ecde574c99a616b70b2512ed8b02d70a773b6 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Mon, 19 Aug 2019 18:01:46 +0200 Subject: [PATCH] envconst dump command (untested) refs #186 --- util/envconst/envconst.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/util/envconst/envconst.go b/util/envconst/envconst.go index 8b8e56f..b5beaaa 100644 --- a/util/envconst/envconst.go +++ b/util/envconst/envconst.go @@ -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)