소스 검색

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

add the constructor NewNativeType
Chris Bannister 8 년 전
부모
커밋
ecc3fdbeba
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  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()
 }