Skip to content

Commit

Permalink
doc/next: introduce module tools
Browse files Browse the repository at this point in the history
Fixes #48429

Change-Id: Ie1954fc3bedd7d36cafaf3835b6c3a92326393f5
Reviewed-on: https://go-review.googlesource.com/c/go/+/632556
Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
  • Loading branch information
ConradIrwin authored and gopherbot committed Dec 5, 2024
1 parent c3a706e commit 6293a06
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions doc/next/3-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,31 @@

### Go command {#go-command}

<!-- go.dev/issue/48429 -->

Go modules can now track executable dependencies using `tool` directives in
go.mod. This removes the need for the previous workaround of adding tools as
blank imports to a file conventionally named "tools.go". The `go tool`
command can now run these tools in addition to tools shipped with the Go
distribution. For more information see [the
documentation](/doc/modules/managing-dependencies#tools).

The new `-tool` flag for `go get` causes a tool directive to be added to the
current module for named packages in addition to adding require directives.

The new [`tool` meta-pattern](/cmd/go#hdr-Package_lists_and_patterns) refers to
all tools in the current module. This can be used to upgrade them all with `go
get -u tool` or to install them into your GOBIN directory with `go install
tool`.

<!-- go.dev/issue/69290 -->

Executables created by `go run` and the new behavior for `go tool` are now
cached in the Go build cache. This makes repeated executions faster at the
expense of making the cache larger. See [#69290](/issue/69290).

<!-- go.dev/issue/62067 -->

The `go build` and `go install` commands now accept a `-json` flag that reports
build output and failures as structured JSON output on standard output.
For details of the reporting format, see `go help buildjson`.
Expand Down

0 comments on commit 6293a06

Please sign in to comment.