github.com/glycerine/zebrapack@v4.1.1-0.20181107023619-e955d028f9bf+incompatible/testdata/my.go (about) 1 package testdata 2 3 import ( 4 "github.com/glycerine/zebrapack/msgp" 5 "time" 6 ) 7 8 //go:generate zebrapack 9 //go:generate zebrapack -msgp -o my_msgp_gen.go -method-prefix=MSGP -io=false -tests=false 10 11 const zebraSchemaId64 int64 = 0x115d33d9fb554 // 305471992870228 12 13 //func main() {} 14 15 type S struct{} 16 17 type S2 struct { 18 A struct{} `zid:"0" msg:"alpha"` 19 B string `msg:"beta" zid:"1"` 20 R map[string]uint8 `zid:"2" msg:"ralph"` 21 P uint16 `zid:"3" msg:",deprecated"` 22 Q uint32 `zid:"4"` 23 T int64 `zid:"5" msg:",showzero"` 24 25 // test const array and *ast.SelectorExpr as array size 26 Arr [msgp.ExtensionPrefixSize]float64 `zid:"6" msg:"arr"` 27 28 MyTree *Tree `zid:"7"` 29 } 30 31 type Tree struct { 32 Chld []Tree `zid:"0"` 33 Str string `zid:"1"` 34 Par *S2 `zid:"2"` 35 } 36 37 type Big struct { 38 Slice []S2 `zid:"0" msg:",showzero"` 39 Transform map[int]*S2 `zid:"1" msg:",showzero"` 40 Myptr *S2 `zid:"2" msg:",showzero"` 41 Myarray [3]string `zid:"3" msg:",showzero"` 42 MySlice []string `zid:"4" msg:",showzero"` 43 } 44 45 type A struct { 46 Name string `zid:"0" msg:"name"` 47 Bday time.Time `zid:"1"` 48 Phone string `zid:"2" msg:"phone,omitempty"` 49 Sibs int `zid:"3" msg:",omitempty"` 50 GPA float64 `zid:"4"` 51 Friend bool `zid:"5"` 52 } 53 54 type Sys struct { 55 F interface{} `zid:"0"` 56 }