https://github.com/tailscale/go-mod-archiver
go.mod git archiver
https://github.com/tailscale/go-mod-archiver
Last synced: 7 months ago
JSON representation
go.mod git archiver
- Host: GitHub
- URL: https://github.com/tailscale/go-mod-archiver
- Owner: tailscale
- License: bsd-3-clause
- Created: 2021-05-24T16:43:17.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2023-08-23T23:46:19.000Z (almost 3 years ago)
- Last Synced: 2025-04-11T16:18:52.880Z (about 1 year ago)
- Language: Go
- Size: 16.6 KB
- Stars: 88
- Watchers: 24
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-mod-archiver
Afraid of being unable to build historical versions of your Go program?
`go mod vendor` lets you check in your dependencies to git, but that's
both bloaty (for developers) and tedious (remembering to update it).
It's nicer to work day-to-day with only `go.mod` (and no `vendor` folder), trusting that
https://proxy.golang.org/ can give you any module version in the future.
Except https://proxy.golang.org/ doesn't necessarily retain everything forever.
Hence this project. **`go-mod-archiver`** is meant to run as a GitHub
Actions workflow and whenever your `go.mod` changes, it runs `go mod
vendor` and commits it into a git tag so you can get your dependent
code in the future if you really need to. (by syncing back to some old
point in time, looking at the SHA-256 of your `go.mod`, and fetching
that tag's `vendor` directory)
## Using
To use `go-mod-archiver`, see https://github.com/bradfitz/go-mod-archiver-test for:
* how to depend on this tool: https://github.com/bradfitz/go-mod-archiver-test/blob/main/tools.go (using the trick from https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module)
* an example GitHub workflow: https://github.com/bradfitz/go-mod-archiver-test/blob/main/.github/workflows/go-mod-archive.yml
## Example result
This is an example tag created by this tool:
https://github.com/bradfitz/go-mod-archiver-test/tree/archive/gomod%2Fa8ea9b345793e2188297f019febc875fb915e94d94f48cce9a4f760413a430b4