go-json/rtype.go

28 lines
395 B
Go
Raw Permalink Normal View History

2020-04-24 14:23:26 +03:00
package json
import (
"reflect"
"unsafe"
2021-03-13 08:12:31 +03:00
"github.com/goccy/go-json/internal/runtime"
)
2020-04-24 14:23:26 +03:00
2021-03-13 08:12:31 +03:00
type rtype = runtime.Type
2020-04-24 14:23:26 +03:00
2021-03-13 08:12:31 +03:00
type emptyInterface struct {
typ *rtype
ptr unsafe.Pointer
2020-04-24 14:23:26 +03:00
}
2021-03-13 08:12:31 +03:00
func rtype_ptrTo(t *rtype) *rtype {
return runtime.PtrTo(t)
2020-04-24 14:23:26 +03:00
}
2021-03-13 08:12:31 +03:00
func rtype2type(t *rtype) reflect.Type {
return runtime.RType2Type(t)
2020-04-24 14:23:26 +03:00
}
func type2rtype(t reflect.Type) *rtype {
2021-03-13 08:12:31 +03:00
return runtime.Type2RType(t)
2020-04-24 14:23:26 +03:00
}