Skip to content
Randall C. O'Reilly edited this page Dec 31, 2018 · 2 revisions

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.

Clone this wiki locally