...

Source file src/go/doc/testdata/examples/whole_file.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  import "fmt"
     8  
     9  type X int
    10  
    11  func (X) Foo() {
    12  }
    13  
    14  func (X) TestBlah() {
    15  }
    16  
    17  func (X) BenchmarkFoo() {
    18  }
    19  
    20  func Example() {
    21  	fmt.Println("Hello, world!")
    22  	// Output: Hello, world!
    23  }
    24  

View as plain text