Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task for Go toolchain install command #71

Merged
merged 1 commit into from
Apr 21, 2021

Commits on Apr 21, 2021

  1. Task for Go toolchain install command

    As of Go version 1.16 `go install $pkg@$version` [1] allows to install
    commands without affecting the `main` module. Additionally commands
    like `go build` and `go test` no longer modify `go.mod` and `go.sum`
    files by default but report an error if a module requirement or checksum
    needs to be added or updated (as if the `-mod=readonly` flag were used).
    This can be used as alternative to the already existing `gobin` runner
    [2].
    
    To support the `go install` command of the Go toolchain [3], a new
    `Task` [4] has been implemented in the new `install` [5] package that
    can be used through a Go toolchain `Runner` [6].
    The task is customizable through the following functions:
    
    - `WithEnv(env map[string]string) install.Option` - sets the task
      specific environment.
    - `WithModulePath(path string) install.Option` - sets the module import
      path.
    - `WithModuleVersion(version *semver.Version) install.Option` - sets the
      module version.
    
    [1]: https://blog.golang.org/go116-module-changes#TOC_4.
    [2]: https://pkg.go.dev/github.com/svengreb/[email protected]/pkg/task/gobin
    [3]: https://pkg.go.dev/cmd/go#hdr-Compile_and_install_packages_and_dependencies
    [4]: https://pkg.go.dev/github.com/svengreb/wand/pkg/task#Task
    [5]: https://pkg.go.dev/github.com/svengreb/wand/pkg/task/golang/install
    [6]: https://pkg.go.dev/github.com/svengreb/wand/pkg/task/golang#Runner
    
    GH-70
    svengreb committed Apr 21, 2021
    Configuration menu
    Copy the full SHA
    7470a27 View commit details
    Browse the repository at this point in the history