-
Notifications
You must be signed in to change notification settings - Fork 2
Cache
The syms
package, cache.go
file has various functions for managing the caching of Symbols and Types generated during parsing.
The overall cache dir is in os.UserCacheDir()/GoPi
, see: os GoDocs which is:
- Linux:
$XDG_CACHE_HOME
or~/.cache
- MacOS (darwin):
~/Library/Cache
- Windows:
%LocalAppData%
Under the GoPi
subdirectory, there are separate directories for each language, e.g., Go
etc.
Files are all saved directly in that one directory, with each file encoded with its path, using % instead of / for path separators.
It is up to the specific language to directly manage the cache saving / loading process -- see Go example ParseDir
method that does this for Go -- the relevant helper code is all in syms/cache.go
which does all the hard work..
Cached data is automatically updated when the parser is updated, or when the files in the directory are newer than the cache.