diff options
Diffstat (limited to 'accounts/abi/reflect.go')
-rw-r--r-- | accounts/abi/reflect.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/accounts/abi/reflect.go b/accounts/abi/reflect.go index e953b77c1..fbcd576e5 100644 --- a/accounts/abi/reflect.go +++ b/accounts/abi/reflect.go @@ -85,3 +85,11 @@ func set(dst, src reflect.Value, output Argument) error { } return nil } + +// requireAssignable assures that `dest` is a pointer and it's not an interface. +func requireAssignable(dst, src reflect.Value) error { + if dst.Kind() != reflect.Ptr && dst.Kind() != reflect.Interface { + return fmt.Errorf("abi: cannot unmarshal %v into %v", src.Type(), dst.Type()) + } + return nil +} |