mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-25 13:47:19 +00:00
vm: fix linter warning
Fix the following linter warning: ``` indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive) ``` Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
parent
890f64007a
commit
39ce3a9d1d
1 changed files with 7 additions and 5 deletions
|
@ -184,13 +184,15 @@ func FromJSON(data []byte, maxCount int, bestIntPrecision bool) (Item, error) {
|
|||
bestIntPrecision: bestIntPrecision,
|
||||
}
|
||||
d.UseNumber()
|
||||
if item, err := d.decode(); err != nil {
|
||||
item, err := d.decode()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if _, err := d.Token(); !errors.Is(err, gio.EOF) {
|
||||
return nil, fmt.Errorf("%w: unexpected items", ErrInvalidValue)
|
||||
} else {
|
||||
return item, nil
|
||||
}
|
||||
_, err = d.Token()
|
||||
if !errors.Is(err, gio.EOF) {
|
||||
return nil, fmt.Errorf("%w: unexpected items", ErrInvalidValue)
|
||||
}
|
||||
return item, nil
|
||||
}
|
||||
|
||||
func (d *decoder) decode() (Item, error) {
|
||||
|
|
Loading…
Reference in a new issue