[tools] cmd/goimports: recommend go install instead of go get in docs

78 views
Skip to first unread message

Heschi Kreinick (Gerrit)

unread,
Oct 12, 2021, 3:23:04 PM10/12/21
to Eric Chiang, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Brad Fitzpatrick, Go Bot, golang-co...@googlegroups.com

Heschi Kreinick submitted this change.

View Change


Approvals: Brad Fitzpatrick: Looks good to me, approved; Trusted Heschi Kreinick: Looks good to me, approved
cmd/goimports: recommend go install instead of go get in docs

go get now logs a warning when using it to install globally. Prefer go
install @latest instead.

Change-Id: I9478771e70c58202847a6dfeaaf63e1b88301d84
Reviewed-on: https://go-review.googlesource.com/c/tools/+/355251
Reviewed-by: Brad Fitzpatrick <brad...@golang.org>
Reviewed-by: Heschi Kreinick <hes...@google.com>
Trust: Brad Fitzpatrick <brad...@golang.org>
---
M cmd/goimports/doc.go
1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/cmd/goimports/doc.go b/cmd/goimports/doc.go
index f344d80..5a5b900 100644
--- a/cmd/goimports/doc.go
+++ b/cmd/goimports/doc.go
@@ -7,7 +7,7 @@
Command goimports updates your Go import lines,
adding missing ones and removing unreferenced ones.

- $ go get golang.org/x/tools/cmd/goimports
+ $ go install golang.org/x/tools/cmd/goimports@latest

In addition to fixing imports, goimports also formats
your code in the same style as gofmt so it can be used

To view, visit change 355251. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: tools
Gerrit-Branch: master
Gerrit-Change-Id: I9478771e70c58202847a6dfeaaf63e1b88301d84
Gerrit-Change-Number: 355251
Gerrit-PatchSet: 2
Gerrit-Owner: Eric Chiang <eric.c...@gmail.com>
Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
Gerrit-Reviewer: Heschi Kreinick <hes...@google.com>
Gerrit-CC: Go Bot <go...@golang.org>
Gerrit-MessageType: merged
Reply all
Reply to author
Forward
0 new messages