aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/strings/example_test.go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2012-02-09 08:19:58 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-02-09 08:19:58 +0000
commit94252f4bcc0a3f487b804ce535cb77b8bef4db83 (patch)
tree7ca86535c5a6b99d4cc432ba5cfddabc5ee4ea16 /libgo/go/strings/example_test.go
parentcd6368115dbd75d9187877097c48a0d8d4c04fd4 (diff)
downloadgcc-94252f4bcc0a3f487b804ce535cb77b8bef4db83.zip
gcc-94252f4bcc0a3f487b804ce535cb77b8bef4db83.tar.gz
gcc-94252f4bcc0a3f487b804ce535cb77b8bef4db83.tar.bz2
libgo: Update to weekly.2012-02-07.
From-SVN: r184034
Diffstat (limited to 'libgo/go/strings/example_test.go')
-rw-r--r--libgo/go/strings/example_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/libgo/go/strings/example_test.go b/libgo/go/strings/example_test.go
new file mode 100644
index 0000000..16e5367
--- /dev/null
+++ b/libgo/go/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 "))
+}