MCPcopy Create free account
hub / github.com/efogdev/mpris-timer / walk

Function walk

internal/core/image.go:183–207  ·  view source on GitHub ↗
(filename string)

Source from the content-addressed store, hash-verified

181}
182
183func walk(filename string) {
184 _ = filepath.Walk(filename, func(path string, info os.FileInfo, err error) error {
185 if err != nil || filename == path {
186 return err
187 }
188
189 if info.IsDir() {
190 walk(path)
191 } else {
192 ext := filepath.Ext(info.Name())
193 switch ext {
194 case ".svg":
195 cacheMu.Lock()
196 cache[path] = struct{}{}
197 cacheMu.Unlock()
198 case ".png":
199 pngCacheMu.Lock()
200 pngCache[path] = struct{}{}
201 pngCacheMu.Unlock()
202 }
203 }
204
205 return nil
206 })
207}

Callers 1

InitCacheFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected