From c77bc9e5e1674152c6e2fc6cbdf5d421472cb7b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Tue, 24 Aug 2021 18:07:35 +0100 Subject: [PATCH] start using "go install pkg@version" in docs Now that Go 1.17.x is out, we no longer need to worry about users on Go 1.15.x. Since Go 1.16, the best way to install programs has been "go install": https://golang.org/doc/go1.16#go-command This method does not interfere with the current module, and allows selecting a version such as "latest" or "master". --- README.md | 4 ++-- shared.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e8004828..307fd861 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # garble - GO111MODULE=on go get mvdan.cc/garble + go install mvdan.cc/garble@latest Obfuscate Go code by wrapping the Go toolchain. Requires Go 1.16 or later. @@ -44,7 +44,7 @@ Note that commands like `garble build` will use the `go` version found in your and set up `$PATH` with them. For example, for Go 1.16.1: ```sh -$ go get golang.org/dl/go1.16.1 +$ go install golang.org/dl/go1.16.1@latest $ go1.16.1 download $ PATH=$(go1.16.1 env GOROOT)/bin:${PATH} garble build ``` diff --git a/shared.go b/shared.go index d4f20f58..d2505191 100644 --- a/shared.go +++ b/shared.go @@ -30,12 +30,12 @@ type sharedCache struct { // useful for type checking of the packages as we obfuscate them. ListedPackages map[string]*listedPackage - // We can't rely on the module version to exist, because it's - // missing in local builds without 'go get'. + // We can't rely on the module version to exist, + // because it's missing in local builds without 'go install'. // For now, use 'go tool buildid' on the garble binary. // Just like Go's own cache, we use hex-encoded sha256 sums. - // Once https://github.com/golang/go/issues/37475 is fixed, we - // can likely just use that. + // Once https://github.com/golang/go/issues/37475 is fixed, + // we can likely just use that. BinaryContentID []byte // From "go env", primarily.