Skip to content

Commit f79c75a

Browse files
milasndeloof
authored andcommitted
test: fix lint errors on Darwin (macOS) (#4247)
Unused code linter isn't particularly smart about platform build tags, so since this func is only used by the "naive" (non-macOS) file watcher, it needs to live with that or it gets flagged as dead code when linting on macOS.
1 parent e62993a commit f79c75a

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

pkg/watch/paths.go

-11
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,6 @@ import (
1010
"github.com/tilt-dev/tilt/internal/ospath"
1111
)
1212

13-
func greatestExistingAncestors(paths []string) ([]string, error) {
14-
result := []string{}
15-
for _, p := range paths {
16-
newP, err := greatestExistingAncestor(p)
17-
if err != nil {
18-
return nil, fmt.Errorf("Finding ancestor of %s: %v", p, err)
19-
}
20-
result = append(result, newP)
21-
}
22-
return result, nil
23-
}
2413
func greatestExistingAncestor(path string) (string, error) {
2514
if path == string(filepath.Separator) ||
2615
path == fmt.Sprintf("%s%s", filepath.VolumeName(path), string(filepath.Separator)) {

pkg/watch/watcher_naive.go

+12
Original file line numberDiff line numberDiff line change
@@ -303,3 +303,15 @@ func newWatcher(paths []string, ignore PathMatcher, l logger.Logger) (*naiveNoti
303303
}
304304

305305
var _ Notify = &naiveNotify{}
306+
307+
func greatestExistingAncestors(paths []string) ([]string, error) {
308+
result := []string{}
309+
for _, p := range paths {
310+
newP, err := greatestExistingAncestor(p)
311+
if err != nil {
312+
return nil, fmt.Errorf("Finding ancestor of %s: %v", p, err)
313+
}
314+
result = append(result, newP)
315+
}
316+
return result, nil
317+
}

0 commit comments

Comments
 (0)