https://github.com/solsw/modcacheclear
modcacheclear tool clears Go module cache
https://github.com/solsw/modcacheclear
cache go module
Last synced: 5 months ago
JSON representation
modcacheclear tool clears Go module cache
- Host: GitHub
- URL: https://github.com/solsw/modcacheclear
- Owner: solsw
- License: mit
- Created: 2023-08-30T07:01:47.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-16T14:43:07.000Z (over 2 years ago)
- Last Synced: 2024-06-21T08:05:05.063Z (almost 2 years ago)
- Topics: cache, go, module
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# modcacheclear
**modcacheclear** tool clears Go [module cache](https://go.dev/ref/mod#module-cache).
**modcacheclear** operates on modules from the [module cache](https://go.dev/ref/mod#module-cache) which have [go.mod](https://go.dev/ref/mod#go-mod-file) file and valid [SemVer](https://semver.org/#semantic-versioning-specification-semver) in the corresponding directory name.
**modcacheclear** without any flags prints [versions](https://go.dev/ref/mod#versions) of all modules (identified with [module paths](https://go.dev/ref/mod#module-path)) from the [module cache](https://go.dev/ref/mod#module-cache).
**modcacheclear** tool supports the following flags:
***-p*** regular expression pattern to match [module path](https://go.dev/ref/mod#module-path)
`modcacheclear -p ^github.com/solsw` prints [versions](https://go.dev/ref/mod#versions) of all modules starting with 'github.com/solsw' from the [module cache](https://go.dev/ref/mod#module-cache).
***-v*** number of module [versions](https://go.dev/ref/mod#versions) to keep
`modcacheclear -p github.com/solsw/modhelper -v 2` removes all but two [versions](https://go.dev/ref/mod#versions) with [maximum](https://semver.org/#spec-item-11) [SemVer](https://semver.org/#semantic-versioning-specification-semver) of 'github.com/solsw/modhelper' module from the [module cache](https://go.dev/ref/mod#module-cache).
`modcacheclear -v 1` removes all but one [version](https://go.dev/ref/mod#versions) with [maximum](https://semver.org/#spec-item-11) [SemVer](https://semver.org/#semantic-versioning-specification-semver) of all modules from the [module cache](https://go.dev/ref/mod#module-cache).
***-a*** remove all module [versions](https://go.dev/ref/mod#versions)
`modcacheclear -p github.com/solsw/modhelper -a` removes all [versions](https://go.dev/ref/mod#versions) of 'github.com/solsw/modhelper' module from the [module cache](https://go.dev/ref/mod#module-cache); if then the parent directory becomes empty, it is also deleted.
***-printskipped*** print skipped [module paths](https://go.dev/ref/mod#module-path)
***-nooutput*** produce no output except errors