MCPcopy Create free account
hub / github.com/cogentcore/core / OpenSymCache

Function OpenSymCache

parse/syms/cache.go:114–126  ·  view source on GitHub ↗

OpenSymCache opens cache of symbols into given symbol (typically a package, module, library), which is at given filename -- returns time stamp when cache was last saved

(lang fileinfo.Known, filename string)

Source from the content-addressed store, hash-verified

112// (typically a package, module, library), which is at given
113// filename -- returns time stamp when cache was last saved
114func OpenSymCache(lang fileinfo.Known, filename string) (*Symbol, time.Time, error) {
115 cfile, err := CacheFilename(lang, filename)
116 if err != nil {
117 return nil, time.Time{}, err
118 }
119 info, err := os.Stat(cfile)
120 if os.IsNotExist(err) {
121 return nil, time.Time{}, err
122 }
123 sy := &Symbol{}
124 err = sy.OpenJSON(cfile)
125 return sy, info.ModTime(), err
126}

Callers 1

ParseDirImplMethod · 0.92

Calls 4

OpenJSONMethod · 0.95
CacheFilenameFunction · 0.85
ModTimeMethod · 0.80
StatMethod · 0.45

Tested by

no test coverage detected