From: Conrad Irwin Date: Sun, 1 Dec 2024 05:13:52 +0000 (-0700) Subject: doc/next: introduce module tools X-Git-Tag: go1.24rc1~22 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=6293a0683171e3a08e275884fddeaa2b57a861f6;p=gostls13.git doc/next: introduce module tools Fixes #48429 Change-Id: Ie1954fc3bedd7d36cafaf3835b6c3a92326393f5 Reviewed-on: https://go-review.googlesource.com/c/go/+/632556 Reviewed-by: Michael Matloob LUCI-TryBot-Result: Go LUCI Auto-Submit: Dmitri Shuralyov Reviewed-by: Dmitri Shuralyov Reviewed-by: Dmitri Shuralyov --- diff --git a/doc/next/3-tools.md b/doc/next/3-tools.md index 93047887e8..fb71ada5d9 100644 --- a/doc/next/3-tools.md +++ b/doc/next/3-tools.md @@ -2,7 +2,31 @@ ### Go command {#go-command} + + +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`. + + + +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). + + 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`.