瀏覽代碼

add the constructor NewNativeType

Vincent Rischmann 8 年之前
父節點
當前提交
a75685ab45
共有 1 個文件被更改,包括 4 次插入0 次删除
  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()
 }