Browse Source

add the constructor NewNativeType

Vincent Rischmann 8 năm trước cách đây
mục cha
commit
a75685ab45
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      marshal.go

+ 4 - 0
marshal.go

@@ -1799,6 +1799,10 @@ type NativeType struct {
 	custom string // only used for TypeCustom
 }
 
+func NewNativeType(proto byte, typ Type, custom string) NativeType {
+	return NativeType{proto, typ, custom}
+}
+
 func (t NativeType) New() interface{} {
 	return reflect.New(goType(t)).Interface()
 }