github.com/hbdrawn/golang@v0.0.0-20141214014649-6b835209aba2/doc/progs/gobs1.go (about)

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