Canonicalize looks up fsString in the mapping from user supplied names to canonical names and return the canonical form
(fsString string)
| 39 | // Canonicalize looks up fsString in the mapping from user supplied |
| 40 | // names to canonical names and return the canonical form |
| 41 | func 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 |
| 54 | func addMapping(fsString, canonicalName string) { |