mirror of https://github.com/docker/compose.git
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.
This commit is contained in:
parent
e62993a854
commit
f79c75ab10
|
@ -10,17 +10,6 @@ import (
|
|||
"github.com/tilt-dev/tilt/internal/ospath"
|
||||
)
|
||||
|
||||
func greatestExistingAncestors(paths []string) ([]string, error) {
|
||||
result := []string{}
|
||||
for _, p := range paths {
|
||||
newP, err := greatestExistingAncestor(p)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Finding ancestor of %s: %v", p, err)
|
||||
}
|
||||
result = append(result, newP)
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
func greatestExistingAncestor(path string) (string, error) {
|
||||
if path == string(filepath.Separator) ||
|
||||
path == fmt.Sprintf("%s%s", filepath.VolumeName(path), string(filepath.Separator)) {
|
||||
|
|
|
@ -303,3 +303,15 @@ func newWatcher(paths []string, ignore PathMatcher, l logger.Logger) (*naiveNoti
|
|||
}
|
||||
|
||||
var _ Notify = &naiveNotify{}
|
||||
|
||||
func greatestExistingAncestors(paths []string) ([]string, error) {
|
||||
result := []string{}
|
||||
for _, p := range paths {
|
||||
newP, err := greatestExistingAncestor(p)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Finding ancestor of %s: %v", p, err)
|
||||
}
|
||||
result = append(result, newP)
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue