Incorporate go-nyet

This commit is contained in:
Tamir Duberstein 2015-05-11 09:48:50 -04:00
parent a15f234cb1
commit fff92e7dec
7 changed files with 21 additions and 13 deletions

View File

@ -5,12 +5,20 @@ regen:
make -C testdata regen make -C testdata regen
.PHONY: check .PHONY: check
check: errcheck check: errcheck go-nyet
errcheck testdata/out/compress-memcopy.go errcheck testdata/out/compress-memcopy.go
errcheck testdata/out/compress-nomemcopy.go errcheck testdata/out/compress-nomemcopy.go
errcheck testdata/out/debug.go errcheck testdata/out/debug.go
errcheck testdata/out/nocompress-memcopy.go errcheck testdata/out/nocompress-memcopy.go
errcheck testdata/out/nocompress-nomemcopy.go errcheck testdata/out/nocompress-nomemcopy.go
go-nyet testdata/out/compress-memcopy.go
go-nyet testdata/out/compress-nomemcopy.go
go-nyet testdata/out/debug.go
go-nyet testdata/out/nocompress-memcopy.go
go-nyet testdata/out/nocompress-nomemcopy.go
errcheck: errcheck:
go get github.com/kisielk/errcheck go get github.com/kisielk/errcheck
go-nyet:
go get github.com/barakmich/go-nyet

View File

@ -231,8 +231,8 @@ func AssetDir(name string) ([]string, error) {
return nil, fmt.Errorf("Asset %s not found", name) return nil, fmt.Errorf("Asset %s not found", name)
} }
rv := make([]string, 0, len(node.Children)) rv := make([]string, 0, len(node.Children))
for name := range node.Children { for childName := range node.Children {
rv = append(rv, name) rv = append(rv, childName)
} }
return rv, nil return rv, nil
} }

View File

@ -241,8 +241,8 @@ func AssetDir(name string) ([]string, error) {
return nil, fmt.Errorf("Asset %s not found", name) return nil, fmt.Errorf("Asset %s not found", name)
} }
rv := make([]string, 0, len(node.Children)) rv := make([]string, 0, len(node.Children))
for name := range node.Children { for childName := range node.Children {
rv = append(rv, name) rv = append(rv, childName)
} }
return rv, nil return rv, nil
} }

View File

@ -182,8 +182,8 @@ func AssetDir(name string) ([]string, error) {
return nil, fmt.Errorf("Asset %s not found", name) return nil, fmt.Errorf("Asset %s not found", name)
} }
rv := make([]string, 0, len(node.Children)) rv := make([]string, 0, len(node.Children))
for name := range node.Children { for childName := range node.Children {
rv = append(rv, name) rv = append(rv, childName)
} }
return rv, nil return rv, nil
} }

View File

@ -199,8 +199,8 @@ func AssetDir(name string) ([]string, error) {
return nil, fmt.Errorf("Asset %s not found", name) return nil, fmt.Errorf("Asset %s not found", name)
} }
rv := make([]string, 0, len(node.Children)) rv := make([]string, 0, len(node.Children))
for name := range node.Children { for childName := range node.Children {
rv = append(rv, name) rv = append(rv, childName)
} }
return rv, nil return rv, nil
} }

View File

@ -221,8 +221,8 @@ func AssetDir(name string) ([]string, error) {
return nil, fmt.Errorf("Asset %s not found", name) return nil, fmt.Errorf("Asset %s not found", name)
} }
rv := make([]string, 0, len(node.Children)) rv := make([]string, 0, len(node.Children))
for name := range node.Children { for childName := range node.Children {
rv = append(rv, name) rv = append(rv, childName)
} }
return rv, nil return rv, nil
} }

4
toc.go
View File

@ -117,8 +117,8 @@ func AssetDir(name string) ([]string, error) {
return nil, fmt.Errorf("Asset %%s not found", name) return nil, fmt.Errorf("Asset %%s not found", name)
} }
rv := make([]string, 0, len(node.Children)) rv := make([]string, 0, len(node.Children))
for name := range node.Children { for childName := range node.Children {
rv = append(rv, name) rv = append(rv, childName)
} }
return rv, nil return rv, nil
} }