Add support for maps.

This commit is contained in:
Alec Thomas
2018-06-13 22:16:43 +10:00
parent 54386f7fa5
commit ecf21e4cc9
7 changed files with 76 additions and 22 deletions
+5 -1
View File
@@ -26,7 +26,11 @@ func JSON(r io.Reader) (ResolverFunc, error) {
if !ok {
return "", nil
}
value, err := jsonDecodeValue(flag.Tag.Sep, raw)
sep := flag.Tag.Sep
if sep == 0 {
sep = ','
}
value, err := jsonDecodeValue(sep, raw)
if err != nil {
return "", err
}