]> Cypherpunks repositories - gostls13.git/commitdiff
net, text/tabwriter: use cap arg to make
authorJosh Bleecher Snyder <josharian@gmail.com>
Thu, 12 Dec 2013 06:13:17 +0000 (10:13 +0400)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 12 Dec 2013 06:13:17 +0000 (10:13 +0400)
Changes generated by:

gofmt -w -r 'make(a, b)[0:0] -> make(a, 0, b)' src/pkg

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/24820045

src/pkg/net/dnsconfig_unix.go
src/pkg/net/parse.go
src/pkg/text/tabwriter/tabwriter_test.go

index 2f0f6c031f13ff89fe32ee7de8333ab3b84379ea..d10f099b1211545e89e0b8fde627d3611178cfaa 100644 (file)
@@ -27,7 +27,7 @@ func dnsReadConfig() (*dnsConfig, error) {
                return nil, &DNSConfigError{err}
        }
        conf := new(dnsConfig)
-       conf.servers = make([]string, 3)[0:0] // small, but the standard limit
+       conf.servers = make([]string, 0, 3) // small, but the standard limit
        conf.search = make([]string, 0)
        conf.ndots = 1
        conf.timeout = 5
index 6056de248e052e39bf0ebed84269a5dcd21ec420..ee6e7e99522a2cc04346e46390d022bfc7f8451b 100644 (file)
@@ -67,7 +67,7 @@ func open(name string) (*file, error) {
        if err != nil {
                return nil, err
        }
-       return &file{fd, make([]byte, os.Getpagesize())[0:0], false}, nil
+       return &file{fd, make([]byte, 0, os.Getpagesize()), false}, nil
 }
 
 func byteIndex(s string, c byte) int {
index ace53564737acb36c3db2c60a24e33dfe4c5ab85..b0526a03f738b616787e3a4ff4fab555b79c9b1a 100644 (file)
@@ -14,7 +14,7 @@ type buffer struct {
        a []byte
 }
 
-func (b *buffer) init(n int) { b.a = make([]byte, n)[0:0] }
+func (b *buffer) init(n int) { b.a = make([]byte, 0, n) }
 
 func (b *buffer) clear() { b.a = b.a[0:0] }