Open findleyr opened 11 months ago
Another interesting point from https://github.com/golang/go/issues/63832#issuecomment-1791125627
This data is necessary for the operation of the tool. It is also stored in a directory that is designed to hold ephemeral data, so it can be removed without issue and excluded by name from backups.
go
or gopls
's build caches are usually os.UserCacheDir()
. They are ephemeral so 'cache' makes sense.the default locations for GOMODCACHE, checksum data, cached vulndb info, GOPATH are under os.UserHomeDir
. go
offers env vars to override some of them.
os.UserConfigDir()
. I wonder if we also need to consider a different location or configuration knob for collected data, or if just garbage collection is sufficient.
I think telemetry metadata files like mode
and weekends
fit well to the purpose of os.UserConfigDir()
, but I am not sure about the collected data. Should we eventually consider to move them to other place outside the config dir?
https://github.com/golang/go/issues/68406#issue-2406350422 has more commentary.
Milestoning this for Go 1.24.
An interesting point that came up in the context of discussing #63832 is that in some organizations data that is persisted "forever" is treated differently from data that is transient. Right now, local telemetry data is persisted until it is manually deleted (see also #63142).
We don't need local data forever: it is only needed for (1) weekly uploading, if telemetry uploading is enabled, (2) local viewing, to see what would be uploaded while making the decision to opt in, and (3) local debugging. For all of those use cases, keeping a few months of recent data is sufficient.
We should therefore garbage collect old data by default.