Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for str (0.14 sec)

  1. doc/go_spec.html

    The non-blank variable names on the left side of <code>:=</code>
    must be <a href="#Uniqueness_of_identifiers">unique</a>.
    </p>
    
    <pre>
    field1, offset := nextField(str, 0)
    field2, offset := nextField(str, offset)  // redeclares offset
    x, y, x := 1, 2, 3                        // illegal: x repeated on left side of :=
    </pre>
    
    <p>
    Short variable declarations may appear only inside functions.
    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)
  2. doc/go1.17_spec.html

    Redeclaration does not introduce a new variable; it just assigns a new value to the original.
    </p>
    
    <pre>
    field1, offset := nextField(str, 0)
    field2, offset := nextField(str, offset)  // redeclares offset
    a, a := 1, 2                              // illegal: double declaration of a or no new variable if a was declared elsewhere
    </pre>
    
    <p>
    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)
Back to top