2017-03-02 Richard Biener <rguenther@suse.de>
[official-gcc.git] / libgo / go / html / example_test.go
blobd0f0a9bd850f4be71963e91ca13917bc0848b4ff
1 // Copyright 2015 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.
5 // +build ignore
7 package html_test
9 import (
10 "fmt"
11 "html"
14 func ExampleEscapeString() {
15 const s = `"Fran & Freddie's Diner" <tasty@example.com>`
16 fmt.Println(html.EscapeString(s))
17 // Output: &#34;Fran &amp; Freddie&#39;s Diner&#34; &lt;tasty@example.com&gt;
20 func ExampleUnescapeString() {
21 const s = `&quot;Fran &amp; Freddie&#39;s Diner&quot; &lt;tasty@example.com&gt;`
22 fmt.Println(html.UnescapeString(s))
23 // Output: "Fran & Freddie's Diner" <tasty@example.com>