summaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/text/cmd/gotext/examples/rewrite
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2018-01-16 12:03:31 -0500
committerGitHub <noreply@github.com>2018-01-16 12:03:31 -0500
commit2fa7c464f019f67c5c0494aaf5ac0f5ecc1ee7a7 (patch)
treee08ff912e1924c06939f314168c3362d6f1ec0de /vendor/golang.org/x/text/cmd/gotext/examples/rewrite
parentf5c8a71698d0a7a16c68be220e49fe64bfee7f5c (diff)
downloadchat-2fa7c464f019f67c5c0494aaf5ac0f5ecc1ee7a7.tar.gz
chat-2fa7c464f019f67c5c0494aaf5ac0f5ecc1ee7a7.tar.bz2
chat-2fa7c464f019f67c5c0494aaf5ac0f5ecc1ee7a7.zip
Updated dependencies and added avct/uasurfer (#8089)
* Updated dependencies and added avct/uasurfer * Added uasurfer to NOTICE.txt
Diffstat (limited to 'vendor/golang.org/x/text/cmd/gotext/examples/rewrite')
-rw-r--r--vendor/golang.org/x/text/cmd/gotext/examples/rewrite/main.go37
-rw-r--r--vendor/golang.org/x/text/cmd/gotext/examples/rewrite/printer.go16
2 files changed, 53 insertions, 0 deletions
diff --git a/vendor/golang.org/x/text/cmd/gotext/examples/rewrite/main.go b/vendor/golang.org/x/text/cmd/gotext/examples/rewrite/main.go
new file mode 100644
index 000000000..2fada451e
--- /dev/null
+++ b/vendor/golang.org/x/text/cmd/gotext/examples/rewrite/main.go
@@ -0,0 +1,37 @@
+// Copyright 2017 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 main
+
+import (
+ "fmt"
+
+ "golang.org/x/text/language"
+ "golang.org/x/text/message"
+)
+
+func main() {
+ var nPizzas = 4
+ // The following call gets replaced by a call to the globally
+ // defined printer.
+ fmt.Println("We ate", nPizzas, "pizzas.")
+
+ p := message.NewPrinter(language.English)
+
+ // Prevent build failure, although it is okay for gotext.
+ p.Println(1024)
+
+ // Replaced by a call to p.
+ fmt.Println("Example punctuation:", "$%^&!")
+
+ {
+ q := message.NewPrinter(language.French)
+
+ const leaveAnIdentBe = "Don't expand me."
+ fmt.Print(leaveAnIdentBe)
+ q.Println() // Prevent build failure, although it is okay for gotext.
+ }
+
+ fmt.Printf("Hello %s\n", "City")
+}
diff --git a/vendor/golang.org/x/text/cmd/gotext/examples/rewrite/printer.go b/vendor/golang.org/x/text/cmd/gotext/examples/rewrite/printer.go
new file mode 100644
index 000000000..9ed055620
--- /dev/null
+++ b/vendor/golang.org/x/text/cmd/gotext/examples/rewrite/printer.go
@@ -0,0 +1,16 @@
+// Copyright 2017 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.
+
+// +build ignore
+
+package main
+
+import (
+ "golang.org/x/text/language"
+ "golang.org/x/text/message"
+)
+
+// The printer defined here will be picked up by the first print statement
+// in main.go.
+var printer = message.NewPrinter(language.English)