Skip to content

Commit 889f777

Browse files
committed
Use Lstat method from github.com/arduino/go-paths-helper module
The github.com/arduino/go-paths-helper Go module is used for the management of filesystem paths in Arduino Lint. Previously, this module did not provide an Lstat capability so the function from the os package was used. An Lstat method was added in github.com/arduino/[email protected] so it is now possible to bring this previously inconsistent part of the path handling code into alignment with that of the rest of the Arduino Lint codebase.
1 parent 26df5d7 commit 889f777

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/project/project.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func findProjectsUnderPath(targetPath *paths.Path, projectTypeFilter projecttype
146146
// It is possible for a combination of symlinks to parent paths to cause project discovery to get stuck in
147147
// an endless loop of recursion. This is avoided by keeping count of the depth of symlinks and discontinuing
148148
// recursion when it exceeds reason.
149-
pathStat, err := os.Lstat(potentialProjectDirectory.String())
149+
pathStat, err := potentialProjectDirectory.Lstat()
150150
if err != nil {
151151
panic(err)
152152
}

internal/rule/rulefunction/library.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func LibraryContainsSymlinks() (result ruleresult.Type, output string) {
9292

9393
symlinkPaths := []string{}
9494
for _, projectPathItem := range projectPathListing {
95-
projectPathItemStat, err := os.Lstat(projectPathItem.String())
95+
projectPathItemStat, err := projectPathItem.Lstat()
9696
if err != nil {
9797
panic(err)
9898
}

0 commit comments

Comments
 (0)