github.com/goccy/go-json@v0.10.3-0.20240509105655-5e2ae3f23c1d/size_test.go (about) 1 package json 2 3 import ( 4 "testing" 5 "unsafe" 6 7 "github.com/goccy/go-json/internal/encoder" 8 ) 9 10 func TestOpcodeSize(t *testing.T) { 11 const uintptrSize = 4 << (^uintptr(0) >> 63) 12 if uintptrSize == 8 { 13 size := unsafe.Sizeof(encoder.Opcode{}) 14 if size != 120 { 15 t.Fatalf("unexpected opcode size: expected 112bytes but got %dbytes", size) 16 } 17 } 18 }