diff options
author | obscuren <geffobscura@gmail.com> | 2014-08-04 22:25:53 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-08-04 22:25:53 +0800 |
commit | 342cc122b43f01301d0188de1e333c32ed64ae8c (patch) | |
tree | a8bfb3288a5866de2a315319124e7a6b908f7bd3 /ethutil/value.go | |
parent | 03ce15df4c7ef51d4373233ab5c3766282b31771 (diff) | |
download | go-tangerine-342cc122b43f01301d0188de1e333c32ed64ae8c.tar.gz go-tangerine-342cc122b43f01301d0188de1e333c32ed64ae8c.tar.zst go-tangerine-342cc122b43f01301d0188de1e333c32ed64ae8c.zip |
Added general Pipe API
Diffstat (limited to 'ethutil/value.go')
-rw-r--r-- | ethutil/value.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ethutil/value.go b/ethutil/value.go index 3128cd724..2233b978c 100644 --- a/ethutil/value.go +++ b/ethutil/value.go @@ -122,6 +122,14 @@ func (val *Value) Bytes() []byte { return []byte{} } +func (val *Value) Err() error { + if err, ok := val.Val.(error); ok { + return err + } + + return nil +} + func (val *Value) Slice() []interface{} { if d, ok := val.Val.([]interface{}); ok { return d @@ -157,6 +165,11 @@ func (val *Value) IsStr() bool { return val.Type() == reflect.String } +func (self *Value) IsErr() bool { + _, ok := self.Val.(error) + return ok +} + // Special list checking function. Something is considered // a list if it's of type []interface{}. The list is usually // used in conjunction with rlp decoded streams. |