Replace json.Unmarshal with json.Decoder().Decode()
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
This commit is contained in:
parent
bf4bc7f97f
commit
f023195a1e
1 changed files with 1 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue