Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for S1 (0.01 sec)

  1. doc/go_spec.html

    (such as the underlying array of a slice).
    </p>
    
    <pre>
    var s1 = []int{1, 2, 3}
    var s2 = s1                    // s2 stores the slice descriptor of s1
    s1 = s1[:1]                    // s1's length is 1 but it still shares its underlying array with s2
    s2[0] = 42                     // setting s2[0] changes s1[0] as well
    fmt.Println(s1, s2)            // prints [42] [42 2 3]
    
    var m1 = make(map[string]int)
    Registered: Tue Sep 09 11:13:09 UTC 2025
    - Last Modified: Tue May 06 19:12:15 UTC 2025
    - 286.2K bytes
    - Viewed (0)
Back to top