-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
#70
Milestone
Comments
svengreb
added a commit
that referenced
this issue
Apr 21, 2021
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/wand@v0.4.1/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
added a commit
that referenced
this issue
Apr 21, 2021
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/wand@v0.4.1/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 Closes GH-70
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As of Go version 1.16
go install $pkg@$version
allows to install commands without affecting themain
module. Additionally commands likego build
andgo test
no longer modifygo.mod
andgo.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.To support the
go install
command of the Go toolchain, a newTask
will be implemented in a new install package that can be used through a Go toolchainRunner
.The task will be 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.The text was updated successfully, but these errors were encountered: