MCPcopy
hub / github.com/syncthing/syncthing / New

Function New

lib/ignore/ignore.go:153–168  ·  view source on GitHub ↗
(fs fs.Filesystem, opts ...Option)

Source from the content-addressed store, hash-verified

151}
152
153func New(fs fs.Filesystem, opts ...Option) *Matcher {
154 m := &Matcher{
155 fs: fs,
156 stop: make(chan struct{}),
157 }
158 for _, opt := range opts {
159 opt(m)
160 }
161 if m.changeDetector == nil {
162 m.changeDetector = newModtimeChecker()
163 }
164 if m.withCache {
165 go m.clean(2 * time.Hour)
166 }
167 return m
168}
169
170// Load and parse a file. The returned error may be of type *ParseError in
171// which case a file was loaded from disk but the patterns could not be

Callers 15

LoadIgnoresMethod · 0.92
TestIssue3164Function · 0.92
TestIgnoresFunction · 0.92
TestWalkSubFunction · 0.92
TestWalkFunction · 0.92
TestIssue1507Function · 0.92
TestRecurseIncludeFunction · 0.92
TestSkipIgnoredDirsFunction · 0.92
TestIncludedSubdirFunction · 0.92

Calls 2

cleanMethod · 0.95
newModtimeCheckerFunction · 0.85

Tested by 15

TestIssue3164Function · 0.74
TestIgnoresFunction · 0.74
TestWalkSubFunction · 0.74
TestWalkFunction · 0.74
TestIssue1507Function · 0.74
TestRecurseIncludeFunction · 0.74
TestSkipIgnoredDirsFunction · 0.74
TestIncludedSubdirFunction · 0.74
TestIgnoreFunction · 0.56
TestExcludesFunction · 0.56