...

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

Documentation: go/doc/testdata/examples

     1  // Copyright 2022 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 (
     8  	"fmt"
     9  	"time"
    10  
    11  	"golang.org/x/time/rate"
    12  )
    13  
    14  func Example() {
    15  	fmt.Println("Hello, world!")
    16  	// Output: Hello, world!
    17  }
    18  
    19  func ExampleLimiter() {
    20  	// Uses fmt, time and rate.
    21  	l := rate.NewLimiter(rate.Every(time.Second), 1)
    22  	fmt.Println(l)
    23  }
    24  

View as plain text