1
0
mirror of https://github.com/golang/go synced 2024-11-27 05:01:19 -07:00

net, text/tabwriter: use cap arg to make

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
This commit is contained in:
Josh Bleecher Snyder 2013-12-12 10:13:17 +04:00 committed by Brad Fitzpatrick
parent cf51702bba
commit 563d0b62b8
3 changed files with 3 additions and 3 deletions

View 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

View 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 {

View 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] }