Skip to content

Commit

Permalink
Merge pull request #325 from gopcua/simple-decode
Browse files Browse the repository at this point in the history
make Decode a bit simpler
  • Loading branch information
magiconair authored Feb 24, 2020
2 parents f16dc85 + ed5e759 commit 4bc2cdf
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions ua/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ type BinaryDecoder interface {

func Decode(b []byte, v interface{}) (int, error) {
val := reflect.ValueOf(v)
n, err := decode(b, val, val.Type().String())
if err != nil {
return n, err
}
return n, nil
return decode(b, val, val.Type().String())
}

func decode(b []byte, val reflect.Value, name string) (n int, err error) {
Expand Down

0 comments on commit 4bc2cdf

Please sign in to comment.