1
0
mirror of https://github.com/golang/go synced 2024-11-25 18:17:56 -07:00

all: fix shadowing bugs found by go tool vet -shadow

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/10328044
This commit is contained in:
Rob Pike 2013-06-20 11:50:44 -07:00
parent 9824b018ce
commit 3e710c0ba5
2 changed files with 5 additions and 3 deletions

View File

@ -553,12 +553,13 @@ func TestRoundTripGzip(t *testing.T) {
res, err := DefaultTransport.RoundTrip(req)
var body []byte
if test.compressed {
gzip, err := gzip.NewReader(res.Body)
var r *gzip.Reader
r, err = gzip.NewReader(res.Body)
if err != nil {
t.Errorf("%d. gzip NewReader: %v", i, err)
continue
}
body, err = ioutil.ReadAll(gzip)
body, err = ioutil.ReadAll(r)
res.Body.Close()
} else {
body, err = ioutil.ReadAll(res.Body)

View File

@ -158,9 +158,10 @@ func (f *File) readdir(n int) (fi []FileInfo, err error) {
names, err := f.Readdirnames(n)
fi = make([]FileInfo, len(names))
for i, filename := range names {
fip, err := Lstat(dirname + filename)
fip, lerr := Lstat(dirname + filename)
if err == nil {
fi[i] = fip
err = lerr
} else {
fi[i] = &fileStat{name: filename}
}