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

Signed-off-by: Antonio Murdaca <me@runcom.ninja>
This commit is contained in:
Antonio Murdaca
2015-04-26 15:02:01 +02:00
parent 92f4bd59ce
commit 26543e0309
5 changed files with 24 additions and 20 deletions
+1 -2
View File
@@ -58,8 +58,7 @@ func FromParam(p string) (Args, error) {
if len(p) == 0 {
return args, nil
}
err := json.Unmarshal([]byte(p), &args)
if err != nil {
if err := json.NewDecoder(strings.NewReader(p)).Decode(&args); err != nil {
return nil, err
}
return args, nil