go-json/internal/encoder/encode_opcode_test.go

19 lines
322 B
Go

package encoder
import (
"testing"
"unsafe"
)
func TestDumpOpcode(t *testing.T) {
var v interface{} = 1
header := (*emptyInterface)(unsafe.Pointer(&v))
typ := header.typ
typeptr := uintptr(unsafe.Pointer(typ))
codeSet, err := CompileToGetCodeSet(typeptr)
if err != nil {
t.Fatal(err)
}
codeSet.Code.Dump()
}