Source file src/go/doc/testdata/examples/import_groups_named.go
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 tm "time" 10 11 r "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 := r.NewLimiter(r.Every(tm.Second), 1) 22 fmt.Println(l) 23 } 24