tinygo icon indicating copy to clipboard operation
tinygo copied to clipboard

feat(os): add UserConfigDir and UserCacheDir

Open mikesmitty opened this issue 3 months ago • 2 comments

Fixes #5040

mikesmitty avatar Sep 18 '25 00:09 mikesmitty

@mikesmitty looks like this needs to be behind a build tag since those functions do not exist in older Go versions.

deadprogram avatar Sep 18 '25 07:09 deadprogram

internal/filepathlite was added in Go 1.23, so we can't rely on it.

We could, however, have our own internal/filepathlite package instead. For that you'd need to modify the following code to add the package as well: https://github.com/tinygo-org/tinygo/blob/3869f76887feef6c444308e7e1531b7cac1bbd10/loader/goroot.go#L245 (Add "internal/filepathlite": false,, and preferably also a note to the files like "This is needed for Go 1.22 compatibility").

aykevl avatar Sep 29 '25 14:09 aykevl