github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/talks/2014/readability/example_test.go (about)

     1  // +build OMIT
     2  
     3  package binary // OMIT
     4  
     5  func ExampleWrite() {
     6  	var buf bytes.Buffer
     7  	var pi float64 = math.Pi
     8  	err := binary.Write(&buf, binary.LittleEndian, pi)
     9  	if err != nil {
    10  		fmt.Println("binary.Write failed:", err)
    11  	}
    12  	fmt.Printf("% x", buf.Bytes())
    13  	// Output: 18 2d 44 54 fb 21 09 40
    14  }