diff options
author | Andrey Mirtchovski <mirtchovski@gmail.com> | 2010-03-02 11:18:22 +1100 |
---|---|---|
committer | Andrey Mirtchovski <mirtchovski@gmail.com> | 2010-03-02 11:18:22 +1100 |
commit | a679e2e1191bf7fd68fc5a14fb9fa7161811a72e (patch) | |
tree | b45fd7a8410e0820c27f203dd754aea946033eaf /doc | |
parent | a69483c91739ecd9f6079f38e9ad85fb0b7b794c (diff) | |
download | go-a679e2e1191bf7fd68fc5a14fb9fa7161811a72e.tar.gz |
strings.Bytes -> []byte for documentation example, src/pkg/* comments, and htmlgen.go
R=rsc, adg
CC=golang-dev
http://codereview.appspot.com/224087
Committer: Andrew Gerrand <adg@golang.org>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/effective_go.html | 3 | ||||
-rw-r--r-- | doc/htmlgen.go | 19 |
2 files changed, 10 insertions, 12 deletions
diff --git a/doc/effective_go.html b/doc/effective_go.html index 684f108de..728e07be1 100644 --- a/doc/effective_go.html +++ b/doc/effective_go.html @@ -2435,7 +2435,6 @@ import ( "http" "io" "log" - "strings" "template" ) @@ -2460,7 +2459,7 @@ func QR(c *http.Conn, req *http.Request) { } func UrlHtmlFormatter(w io.Writer, v interface{}, fmt string) { - template.HTMLEscape(w, strings.Bytes(http.URLEscape(v.(string)))) + template.HTMLEscape(w, []byte(http.URLEscape(v.(string)))) } diff --git a/doc/htmlgen.go b/doc/htmlgen.go index 8d44fc078..e4a2b5293 100644 --- a/doc/htmlgen.go +++ b/doc/htmlgen.go @@ -15,22 +15,21 @@ import ( "bytes"; "log"; "os"; - "strings"; ) var ( lines = make([][]byte, 0, 10000); // assume big enough linebuf = make([]byte, 10000); // assume big enough - empty = strings.Bytes(""); - newline = strings.Bytes("\n"); - tab = strings.Bytes("\t"); - quote = strings.Bytes(`"`); + empty = []byte(""); + newline = []byte("\n"); + tab = []byte("\t"); + quote = []byte(`"`); - sectionMarker = strings.Bytes("----\n"); - preStart = strings.Bytes("<pre>"); - preEnd = strings.Bytes("</pre>\n"); - pp = strings.Bytes("<p>\n"); + sectionMarker = []byte("----\n"); + preStart = []byte("<pre>"); + preEnd = []byte("</pre>\n"); + pp = []byte("<p>\n"); ); func main() { @@ -119,7 +118,7 @@ func headings() { b := bufio.NewWriter(os.Stdout); for i, l := range lines { if i > 0 && bytes.Equal(l, sectionMarker) { - lines[i-1] = strings.Bytes("<h2>" + string(trim(lines[i-1])) + "</h2>\n"); + lines[i-1] = []byte("<h2>" + string(trim(lines[i-1])) + "</h2>\n"); lines[i] = empty; } } |