...

Source file src/go/doc/testdata/examples/values.go

Documentation: go/doc/testdata/examples

     1  // Copyright 2021 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package foo_test
     6  
     7  // Variable declaration with fewer values than names.
     8  
     9  func f() (int, int) {
    10  	return 1, 2
    11  }
    12  
    13  var a, b = f()
    14  
    15  // Need two examples to hit playExample.
    16  
    17  func ExampleA() {
    18  	_ = a
    19  }
    20  
    21  func ExampleB() {
    22  }
    23  

View as plain text