Explorar o código

add the constructor NewNativeType

Vincent Rischmann %!s(int64=8) %!d(string=hai) anos
pai
achega
a75685ab45
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      marshal.go

+ 4 - 0
marshal.go

@@ -1799,6 +1799,10 @@ type NativeType struct {
 	custom string // only used for TypeCustom
 	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{} {
 func (t NativeType) New() interface{} {
 	return reflect.New(goType(t)).Interface()
 	return reflect.New(goType(t)).Interface()
 }
 }