Fixed errcheck linter complaints

This commit is contained in:
2019-06-05 15:45:54 +09:00
parent 190a85fe08
commit 940e949a30
15 changed files with 112 additions and 33 deletions

View File

@ -64,7 +64,7 @@ func mkclean(file string) error {
// Read files in a given directory and apply a function on them
func readFiles(root string, onFile func(string) error) {
filepath.Walk(root, func(name string, info os.FileInfo, err error) error {
err := filepath.Walk(root, func(name string, info os.FileInfo, err error) error {
if err != nil {
color.Red(err.Error())
return err
@ -87,4 +87,8 @@ func readFiles(root string, onFile func(string) error) {
// Always continue traversing the directory
return nil
})
if err != nil {
color.Red(err.Error())
}
}