github.com/huandu/go@v0.0.0-20151114150818-04e615e41150/doc/progs/gobs1.go (about) 1 // Copyright 2011 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package gobs1 6 7 type T struct{ X, Y, Z int } // Only exported fields are encoded and decoded. 8 var t = T{X: 7, Y: 0, Z: 8} 9 10 // STOP OMIT 11 12 type U struct{ X, Y *int8 } // Note: pointers to int8s 13 var u U 14 15 // STOP OMIT 16 17 type Node struct { 18 Value int 19 Left, Right *Node 20 } 21 22 // STOP OMIT