Add a missing trailing 'e' to the encoding of maps

This commit is contained in:
Justin Li 2014-07-06 17:49:28 -04:00
parent e1575d1fa3
commit 09515864db
2 changed files with 2 additions and 7 deletions

View file

@ -83,6 +83,7 @@ func marshal(w io.Writer, data interface{}) error {
return err
}
}
fmt.Fprintf(w, "e")
case []string:
fmt.Fprintf(w, "l")

View file

@ -25,13 +25,7 @@ var tests = []struct {
{[]string{"one", "two"}, "l3:one3:twoe"},
{[]string{}, "le"},
{
map[string]interface{}{
"one": "aa",
"two": "bb",
},
"d3:one2:aa3:two2:bbe",
},
{map[string]interface{}{"one": "aa", "two": "bb"}, "d3:one2:aa3:two2:bbe"},
{map[string]interface{}{}, "de"},
}