Browse Source

Merge pull request #874 from vrischmann/new-native-type

add the constructor NewNativeType
Chris Bannister 8 years ago
parent
commit
ecc3fdbeba
1 changed files with 4 additions and 0 deletions
  1. 4 0
      marshal.go

+ 4 - 0
marshal.go

@@ -1813,6 +1813,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()
 }