Categorygithub.com/sagikazarmark/moddown
repositorypackage
0.4.0
Repository: https://github.com/sagikazarmark/moddown.git
Documentation: pkg.go.dev

# README

Go Module downloader

GitHub Workflow Status Go Report Card PkgGoDev

moddown is a simplified version of fetch_repo. It focuses on downloading a module using go mod download. Unlike fetch_repo, this tool does not create a dummy module and uses the -modcacherw flag to make the cache writable (removable), so it requires at least Go 1.14.

Usage

The basic functionality of moddown includes:

  • downloading a module (by calling go mod download under the hood)
  • checking the module sum against a known value
  • copying files to a destination directory
./moddown -sum h1:snD5ODyv4c9DOBBZh645dy/TziVHZivuFtRRMZP8zK8= -dest ./emperror emperror.dev/[email protected]

moddown can also use existing module information and delegate downloading to the Go tool:

go mod download -modcacherw -x -json emperror.dev/[email protected] > mod.json
./moddown -sum h1:snD5ODyv4c9DOBBZh645dy/TziVHZivuFtRRMZP8zK8= -f mod.json

# OR pipe from stdin directly

go mod download -modcacherw -x -json emperror.dev/[email protected] | ./moddown -v -sum h1:snD5ODyv4c9DOBBZh645dy/TziVHZivuFtRRMZP8zK8= -f -

Last, but not least: you can enable verbose logging with -v.

Development

Contributions are welcome! :)

  1. Clone the repository
  2. Make changes on a new branch
  3. Run the test suite:
    ./pleasew build
    ./pleasew test
    ./pleasew lint
    
  4. Commit, push and open a PR

License

The MIT License (MIT). Please see License File for more information.