Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for Burns (0.17 sec)

  1. doc/go_spec.html

    </pre>
    
    <p>
    A <a href="#Type_parameter_declarations">type parameter</a> or a <a href="#Type_declarations">generic type</a>
    may be used as a type in a case. If upon <a href="#Instantiations">instantiation</a> that type turns
    out to duplicate another entry in the switch, the first matching case is chosen.
    </p>
    
    <pre>
    func f[P any](x any) int {
    	switch x.(type) {
    	case P:
    		return 0
    	case string:
    		return 1
    HTML
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Apr 26 00:39:16 GMT 2024
    - 279.6K bytes
    - Viewed (0)
Back to top