pkg/eval/vals: Clean up FromGo.

This commit is contained in:
Qi Xiao 2021-04-06 22:38:56 +01:00
parent 6052a4dc4a
commit a5baad65f8

View File

@ -108,18 +108,9 @@ func ScanToGo(src interface{}, ptr interface{}) error {
func FromGo(a interface{}) interface{} {
switch a := a.(type) {
case *big.Int:
if i, ok := getInt(a); ok {
return i
}
return a
return NormalizeBigInt(a)
case *big.Rat:
if a.IsInt() {
if i, ok := getInt(a.Num()); ok {
return i
}
return a.Num()
}
return a
return NormalizeBigRat(a)
case rune:
return string(a)
default: