Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for testdata (0.16 sec)

  1. doc/go1.17_spec.html

    If the iteration variables are declared outside the "for" statement,
    after execution their values will be those of the last iteration.
    </p>
    
    <pre>
    var testdata *struct {
    	a *[7]int
    }
    for i, _ := range testdata.a {
    	// testdata.a is never evaluated; len(testdata.a) is constant
    	// i ranges from 0 to 6
    	f(i)
    }
    
    var a [10]string
    for i, s := range a {
    	// type of i is int
    	// type of s is string
    HTML
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Apr 11 20:22:45 GMT 2024
    - 211.6K bytes
    - Viewed (0)
  2. doc/go_spec.html

    if there is no iteration variable, <code>n</code> must be assignable to <code>int</code>.
    </p>
    
    <pre>
    var testdata *struct {
    	a *[7]int
    }
    for i, _ := range testdata.a {
    	// testdata.a is never evaluated; len(testdata.a) is constant
    	// i ranges from 0 to 6
    	f(i)
    }
    
    var a [10]string
    for i, s := range a {
    	// type of i is int
    	// type of s is string
    HTML
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Apr 11 20:22:45 GMT 2024
    - 279.3K bytes
    - Viewed (0)
Back to top