Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ExampleWrite (0.2 sec)

  1. src/encoding/binary/example_test.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package binary_test
    
    import (
    	"bytes"
    	"encoding/binary"
    	"fmt"
    	"math"
    )
    
    func ExampleWrite() {
    	buf := new(bytes.Buffer)
    	var pi float64 = math.Pi
    	err := binary.Write(buf, binary.LittleEndian, pi)
    	if err != nil {
    		fmt.Println("binary.Write failed:", err)
    	}
    	fmt.Printf("% x", buf.Bytes())
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 3.2K bytes
    - Viewed (0)
Back to top