Skip to content

Commit

Permalink
start using "go install pkg@version" in docs
Browse files Browse the repository at this point in the history
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".
  • Loading branch information
mvdan committed Aug 24, 2021
1 parent 0f1ac89 commit c77bc9e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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
```
Expand Down
8 changes: 4 additions & 4 deletions shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c77bc9e

Please sign in to comment.