github.com/axw/llgo@v0.0.0-20160805011314-95b5fe4dca20/third_party/gofrontend/libgo/go/html/example_test.go (about)

     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.
     4  
     5  // +build ignore
     6  
     7  package html_test
     8  
     9  import (
    10  	"fmt"
    11  	"html"
    12  )
    13  
    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;
    18  }
    19  
    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>
    24  }