Skip to content

Commit

Permalink
decode: allow int64 or bigint
Browse files Browse the repository at this point in the history
  • Loading branch information
chrsm committed Dec 29, 2022
1 parent 19d24a3 commit 11b70e1
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion rpa.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,21 @@ func Decode(r *os.File) (*RPA, error) {
// pickle.Tuple is an []interface{} in a fancy hat
val := (v.([]interface{})[0]).(pickle.Tuple)

ofs, sz := val[0].(*big.Int).Int64(), val[1].(*big.Int).Int64()
var ofs, sz int64

switch nv := val[0].(type) {
case *big.Int:
ofs = nv.Int64()
case int64:
ofs = nv
}

switch nv := val[1].(type) {
case *big.Int:
sz = nv.Int64()
case int64:
sz = nv
}

pak.Indexes = append(pak.Indexes, Index{
Name: k.(string),
Expand Down

0 comments on commit 11b70e1

Please sign in to comment.