add support to make map separator configurable
This commit is contained in:
committed by
Alec Thomas
parent
ca3a30c5f1
commit
529703d8d1
@@ -408,6 +408,7 @@ func mapDecoder(r *Registry) MapperFunc {
|
||||
target.Set(reflect.MakeMap(target.Type()))
|
||||
}
|
||||
el := target.Type()
|
||||
sep := ctx.Value.Tag.MapSep
|
||||
var childScanner *Scanner
|
||||
if ctx.Value.Flag != nil {
|
||||
t := ctx.Scan.Pop()
|
||||
@@ -417,7 +418,7 @@ func mapDecoder(r *Registry) MapperFunc {
|
||||
}
|
||||
switch v := t.Value.(type) {
|
||||
case string:
|
||||
childScanner = Scan(SplitEscaped(v, ';')...)
|
||||
childScanner = Scan(SplitEscaped(v, sep)...)
|
||||
|
||||
case []map[string]interface{}:
|
||||
for _, m := range v {
|
||||
|
||||
Reference in New Issue
Block a user