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 | 488428d25a8ef9cfd09cce718956406b7c8b5904 (patch) | |
| tree | b45fd7a8410e0820c27f203dd754aea946033eaf /doc/htmlgen.go | |
| parent | 629eba4cbbab8ec1abcef3993e259fbd79f5e1cd (diff) | |
| download | golang-488428d25a8ef9cfd09cce718956406b7c8b5904.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/htmlgen.go')
| -rw-r--r-- | doc/htmlgen.go | 19 |
1 files changed, 9 insertions, 10 deletions
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; } } |
