@@ -18,6 +18,7 @@ package abi
1818
1919import (
2020 "encoding/json"
21+ "errors"
2122 "fmt"
2223 "reflect"
2324 "strings"
@@ -79,7 +80,7 @@ func (arguments Arguments) isTuple() bool {
7980func (arguments Arguments ) Unpack (data []byte ) ([]interface {}, error ) {
8081 if len (data ) == 0 {
8182 if len (arguments .NonIndexed ()) != 0 {
82- return nil , fmt . Errorf ("abi: attempting to unmarshall an empty string while arguments are expected" )
83+ return nil , errors . New ("abi: attempting to unmarshall an empty string while arguments are expected" )
8384 }
8485 return make ([]interface {}, 0 ), nil
8586 }
@@ -90,11 +91,11 @@ func (arguments Arguments) Unpack(data []byte) ([]interface{}, error) {
9091func (arguments Arguments ) UnpackIntoMap (v map [string ]interface {}, data []byte ) error {
9192 // Make sure map is not nil
9293 if v == nil {
93- return fmt . Errorf ("abi: cannot unpack into a nil map" )
94+ return errors . New ("abi: cannot unpack into a nil map" )
9495 }
9596 if len (data ) == 0 {
9697 if len (arguments .NonIndexed ()) != 0 {
97- return fmt . Errorf ("abi: attempting to unmarshall an empty string while arguments are expected" )
98+ return errors . New ("abi: attempting to unmarshall an empty string while arguments are expected" )
9899 }
99100 return nil // Nothing to unmarshal, return
100101 }
@@ -116,7 +117,7 @@ func (arguments Arguments) Copy(v interface{}, values []interface{}) error {
116117 }
117118 if len (values ) == 0 {
118119 if len (arguments .NonIndexed ()) != 0 {
119- return fmt . Errorf ("abi: attempting to copy no values while arguments are expected" )
120+ return errors . New ("abi: attempting to copy no values while arguments are expected" )
120121 }
121122 return nil // Nothing to copy, return
122123 }
0 commit comments