aboutsummaryrefslogtreecommitdiff
path: root/internal/scanner/walker.go
diff options
context:
space:
mode:
authorRanXom <saiyedshizain@gmail.com>2026-07-13 02:01:58 +0530
committerRanXom <saiyedshizain@gmail.com>2026-07-13 02:01:58 +0530
commit9cd148b0fcc711edcac8c6becf8ea3cd31c871eb (patch)
tree872fc37a63a90f23b2b7a3a5542b814ad75fa9a5 /internal/scanner/walker.go
parentdc0bd0a705c21ce7fdccbb576534d74bc9f513cc (diff)
downloadgalleryd-9cd148b0fcc711edcac8c6becf8ea3cd31c871eb.tar.xz
galleryd-9cd148b0fcc711edcac8c6becf8ea3cd31c871eb.zip
doc(scanner): document public APIfeat/scanner
Diffstat (limited to 'internal/scanner/walker.go')
-rw-r--r--internal/scanner/walker.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/scanner/walker.go b/internal/scanner/walker.go
index 20a1766..76268e1 100644
--- a/internal/scanner/walker.go
+++ b/internal/scanner/walker.go
@@ -6,6 +6,7 @@ import (
"path/filepath"
)
+// Intentionally unexported and scans exactly one root
func (s *Scanner) walk(ctx context.Context, root string) ([]File, error) {
files := make([]File, 0)
@@ -36,6 +37,10 @@ func (s *Scanner) walk(ctx context.Context, root string) ([]File, error) {
return nil
}
+ // Ignore symbolic links.
+ //
+ // Following symlinks can lead to cycles, duplicate scans and
+ // traversal outside configured roots.
if shouldSkipFile(d.Name()) {
return nil
}