Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
afa50b4fca
|
|||
09acd79fe8
|
|||
0f1586393b
|
|||
0d49b3e716
|
@ -259,7 +259,7 @@ func (c *Config) Status() (ok bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func cleanKey(key string) string {
|
func cleanKey(key string) string {
|
||||||
expr := regexp.MustCompile("_+")
|
expr := regexp.MustCompile("__+")
|
||||||
fn := func(r rune) rune {
|
fn := func(r rune) rune {
|
||||||
if (r >= '0' && r <= '9') || (r >= 'A' && r <= 'Z') || r == '_' {
|
if (r >= '0' && r <= '9') || (r >= 'A' && r <= 'Z') || r == '_' {
|
||||||
return r
|
return r
|
||||||
@ -267,7 +267,7 @@ func cleanKey(key string) string {
|
|||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
key = strings.Map(fn, strings.ToUpper(key))
|
key = strings.Trim(strings.Map(fn, strings.ToUpper(key)), "_")
|
||||||
return expr.ReplaceAllString(key, "_")
|
return expr.ReplaceAllString(key, "_")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -302,7 +302,7 @@ func (c *Config) getRawMap(key string, dtype DataType) (empty map[string]cValue)
|
|||||||
|
|
||||||
if ok {
|
if ok {
|
||||||
for k, v := range entries {
|
for k, v := range entries {
|
||||||
if v.dtype == dtype {
|
if (v.dtype == dtype) && (v.parsed.err == nil) {
|
||||||
retval[k] = v.parsed
|
retval[k] = v.parsed
|
||||||
} else {
|
} else {
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user