Skip to content

Commit fe4cd8b

Browse files
committed
fixes from "task check"
1 parent 05576c9 commit fe4cd8b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

arduino/builder/sketch.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ package builder
1717

1818
import (
1919
"bytes"
20+
"fmt"
2021
"io/ioutil"
2122
"os"
2223
"path/filepath"
2324
"regexp"
2425
"strings"
25-
"fmt"
2626

2727
"github.com/arduino/arduino-cli/arduino/globals"
2828
"github.com/arduino/arduino-cli/arduino/sketch"
@@ -59,8 +59,7 @@ func SketchSaveItemCpp(item *sketch.Item, destPath string) error {
5959
return nil
6060
}
6161

62-
// SimpleLocalWalk locally replaces filepath.Walk and/but goes through symlinks
63-
func SimpleLocalWalkRecursive(root string, maxDepth int, walkFn func(path string, info os.FileInfo, err error) error) error {
62+
func simpleLocalWalkRecursive(root string, maxDepth int, walkFn func(path string, info os.FileInfo, err error) error) error {
6463

6564
info, err := os.Stat(root)
6665

@@ -75,13 +74,13 @@ func SimpleLocalWalkRecursive(root string, maxDepth int, walkFn func(path string
7574

7675
if info.IsDir() {
7776
if maxDepth <= 0 {
78-
return walkFn(root, info, errors.New("Filesystem bottom is too deep (directory recursion or filesystem really deep): " + root))
77+
return walkFn(root, info, errors.New("Filesystem bottom is too deep (directory recursion or filesystem really deep): "+root))
7978
}
8079
maxDepth--
8180
files, err := ioutil.ReadDir(root)
8281
if err == nil {
8382
for _, file := range files {
84-
err = SimpleLocalWalkRecursive(root+string(os.PathSeparator)+file.Name(), maxDepth, walkFn)
83+
err = simpleLocalWalkRecursive(root+string(os.PathSeparator)+file.Name(), maxDepth, walkFn)
8584
if err == filepath.SkipDir {
8685
return nil
8786
}
@@ -92,9 +91,10 @@ func SimpleLocalWalkRecursive(root string, maxDepth int, walkFn func(path string
9291
return nil
9392
}
9493

94+
// SimpleLocalWalk locally replaces filepath.Walk and/but goes through symlinks
9595
func SimpleLocalWalk(root string, walkFn func(path string, info os.FileInfo, err error) error) error {
9696
// see discussion in https://github.com/arduino/arduino-cli/pull/421
97-
return SimpleLocalWalkRecursive(root, 40, walkFn)
97+
return simpleLocalWalkRecursive(root, 40, walkFn)
9898
}
9999

100100
// SketchLoad collects all the files composing a sketch.
@@ -137,7 +137,7 @@ func SketchLoad(sketchPath, buildPath string) (*sketch.Sketch, error) {
137137

138138
if err != nil {
139139
fmt.Printf("\nerror: %+v\n\n", err)
140-
return filepath.SkipDir;
140+
return filepath.SkipDir
141141
}
142142

143143
// ignore hidden files and skip hidden directories

0 commit comments

Comments
 (0)