Search Options

Results per page
Sort
Preferred Languages
Advance

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

  1. doc/go1.17_spec.html

    </pre>
    
    <p>
    In a function without a result type, a "return" statement must not
    specify any result values.
    </p>
    <pre>
    func noResult() {
    	return
    }
    </pre>
    
    <p>
    There are three ways to return values from a function with a result
    type:
    </p>
    
    <ol>
    	<li>The return value or values may be explicitly listed
    HTML
    - Registered: Tue May 07 11:14:38 GMT 2024
    - Last Modified: Thu Apr 11 20:22:45 GMT 2024
    - 211.6K bytes
    - Viewed (0)
  2. src/cmd/cgo/internal/test/callback.go

    //export goReturnVal
    func goReturnVal() (r C.int) {
    	// Force a stack copy.
    	var f func(int) int
    	f = func(i int) int {
    		var buf [256]byte
    		use(buf[:])
    		if i == 0 {
    			return 0
    		}
    		return i + f(i-1)
    	}
    	r = C.int(f(128))
    	return
    }
    
    // Test that C can pass in a Go string from a string constant.
    func testCallGoWithString(t *testing.T) {
    	C.callGoWithString()
    	want := "string passed from C to Go"
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri May 12 12:00:02 GMT 2023
    - 111.5K bytes
    - Viewed (0)
Back to top