Replace json.Unmarshal with json.Decoder().Decode()

Signed-off-by: Antonio Murdaca <me@runcom.ninja>
This commit is contained in:
Antonio Murdaca 2015-04-22 00:47:51 +02:00
parent bf4bc7f97f
commit f023195a1e

View file

@ -58,8 +58,7 @@ func FromParam(p string) (Args, error) {
if len(p) == 0 { if len(p) == 0 {
return args, nil return args, nil
} }
err := json.Unmarshal([]byte(p), &args) if err := json.NewDecoder(strings.NewReader(p)).Decode(&args); err != nil {
if err != nil {
return nil, err return nil, err
} }
return args, nil return args, nil