Skip to content

Commit

Permalink
checking errors in fs walk
Browse files Browse the repository at this point in the history
  • Loading branch information
zserge committed Jun 27, 2015
1 parent 801bb3f commit 3e836ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions usb_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ func walker(path string, cb func(Device)) error {
}

func UsbWalk(cb func(Device)) {
filepath.Walk(DevBusUsb, func(f string, fi os.FileInfo, _ error) error {
if fi.IsDir() {
filepath.Walk(DevBusUsb, func(f string, fi os.FileInfo, err error) error {
if err != nil || fi.IsDir() {
return nil
}
if err := walker(f, cb); err != nil {
Expand Down

0 comments on commit 3e836ce

Please sign in to comment.