Skip to content

Commit ba96a3f

Browse files
committed
Day 2 of Debugging
1 parent 443a10d commit ba96a3f

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

utils/config/config.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,19 @@ func transformChildren(config *koanf.Koanf, path string, transform func(key stri
163163
// Does the same thing as transformChildren() but does it for each Array Item inside of root and transforms subPath
164164
func transformChildrenUnderArray(config *koanf.Koanf, root string, subPath string, transform func(key string, value any) (string, any)) error {
165165
var array []map[string]any
166-
if err := config.Unmarshal(root, &array); err != nil {
166+
167+
err := config.Unmarshal(root, &array)
168+
if err != nil {
167169
return err
168170
}
169171

170172
for i := range array {
171173
path := root + "." + strconv.Itoa(i) + "." + subPath
172174

175+
log.Dev(path)
176+
173177
if config.Exists(path) {
178+
log.Dev("Exists")
174179
transformChildren(config, path, transform)
175180
}
176181
}

utils/config/loader.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ type ENV_ struct {
2626
}
2727

2828
type SETTING_ struct {
29-
BLOCKED_ENDPOINTS []string `koanf:"blockedendpoints"`
30-
VARIABLES map[string]any `koanf:"variables"`
31-
MESSAGE_ALIASES []middlewareTypes.MessageAlias `koanf:"messagealiases"`
29+
BLOCKED_ENDPOINTS []string `koanf:"blockedendpoints"`
30+
VARIABLES map[string]any `koanf:"variables"`
31+
MESSAGE_ALIASES []middlewareTypes.MessageAlias `koanf:"messagealiases"`
3232
}
3333

3434
var ENV *ENV_ = &ENV_{

utils/config/token-config.go renamed to utils/config/tokens.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@ func LoadTokens() {
1919

2020
LoadDir("tokenConfigs", ENV.TOKENS_DIR, tokensLayer, yaml.Parser())
2121

22-
/*
2322
normalizeKeys(tokensLayer)
2423

2524
templateConfig(tokensLayer)
26-
*/
2725
}
2826

2927
func InitTokens() {

0 commit comments

Comments
 (0)