diff options
| author | Brad Fitzpatrick <bradfitz@golang.org> | 2012-02-03 11:17:55 -0800 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2012-02-03 11:17:55 -0800 |
| commit | 10f1b6a0744bac6af16c72a48448027e7041ea25 (patch) | |
| tree | eccaa43d637d441c90b768dfeef3f38d8da1454d /src/pkg/strings | |
| parent | a044154a4c82af185d56ed5826d9946cd065178b (diff) | |
| download | go-10f1b6a0744bac6af16c72a48448027e7041ea25.tar.xz | |
strings: add Fields example
R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/5629043
Diffstat (limited to 'src/pkg/strings')
| -rw-r--r-- | src/pkg/strings/example_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/pkg/strings/example_test.go b/src/pkg/strings/example_test.go new file mode 100644 index 0000000000..16e53678b2 --- /dev/null +++ b/src/pkg/strings/example_test.go @@ -0,0 +1,15 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package strings_test + +import ( + "fmt" + "strings" +) + +// Fields are: ["foo" "bar" "baz"] +func ExampleFields() { + fmt.Printf("Fields are: %q", strings.Fields(" foo bar baz ")) +} |
