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:
parent
cf51702bba
commit
563d0b62b8
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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] }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user