Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for playExample (0.1 sec)

  1. src/go/doc/testdata/examples/values.go

    package foo_test
    
    // Variable declaration with fewer values than names.
    
    func f() (int, int) {
    	return 1, 2
    }
    
    var a, b = f()
    
    // Need two examples to hit playExample.
    
    func ExampleA() {
    	_ = a
    }
    
    func ExampleB() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 10 23:13:45 UTC 2022
    - 377 bytes
    - Viewed (0)
  2. src/go/doc/testdata/examples/iota.go

    // be trimmed. The third has an iota, but is unused, so it can be eliminated.
    
    func Example() {
    	_ = b
    	_ = d
    }
    
    // Need two examples to hit the playExample function.
    
    func Example2() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 10 23:13:45 UTC 2022
    - 596 bytes
    - Viewed (0)
  3. src/go/doc/example.go

    		return true
    	}
    	rune, _ := utf8.DecodeRuneInString(name[len(prefix):])
    	return !unicode.IsLower(rune)
    }
    
    // playExample synthesizes a new *ast.File based on the provided
    // file with the provided function body as the body of main.
    func playExample(file *ast.File, f *ast.FuncDecl) *ast.File {
    	body := f.Body
    
    	if !strings.HasSuffix(file.Name.Name, "_test") {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 21.4K bytes
    - Viewed (0)
Back to top