MCPcopy
hub / github.com/rclone/rclone / Canonicalize

Function Canonicalize

fs/cache/cache.go:41–51  ·  view source on GitHub ↗

Canonicalize looks up fsString in the mapping from user supplied names to canonical names and return the canonical form

(fsString string)

Source from the content-addressed store, hash-verified

39// Canonicalize looks up fsString in the mapping from user supplied
40// names to canonical names and return the canonical form
41func Canonicalize(fsString string) string {
42 createOnFirstUse()
43 mu.Lock()
44 canonicalName, ok := remap[fsString]
45 mu.Unlock()
46 if !ok {
47 return fsString
48 }
49 fs.Debugf(nil, "fs cache: switching user supplied name %q for canonical name %q", fsString, canonicalName)
50 return canonicalName
51}
52
53// Put in a mapping from fsString => canonicalName if they are different
54func addMapping(fsString, canonicalName string) {

Callers 2

getVFSFunction · 0.92
GetFnFunction · 0.85

Calls 4

DebugfFunction · 0.92
createOnFirstUseFunction · 0.85
LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…