]> Cypherpunks repositories - gostls13.git/commit
cmd/api: rewrite as package test
authorRuss Cox <rsc@golang.org>
Wed, 23 Nov 2022 19:16:53 +0000 (14:16 -0500)
committerGopher Robot <gobot@golang.org>
Mon, 28 Nov 2022 16:27:03 +0000 (16:27 +0000)
commit0a8055ef3f84673dc3a70ce5143bdf9817986dea
treebe57d442ea3d5c8fcd93ea626e0782e8063ee459
parent76ec47eeec0e61bd5c679412ec847cdfaf1a95bb
cmd/api: rewrite as package test

No one ever runs 'go tool api', because the invocation
has gotten unwieldy enough that it's not practical.
And we don't support it as a standalone tool for other
packages - it's not even in the distribution.

Making it an ordinary package test lets us invoke it
more easily from cmd/dist (as go test cmd/api -check)
and avoids the increasingly baroque code in run.go to
build a command line.

Left in cmd/api even though it's no longer a command
because (1) it uses a package from cmd/vendor and
(2) it uses internal/testenv. Otherwise it could be misc/api.

Fixes #56845.

Change-Id: I00a13d9c19b1e259fa0e6bb93d1a4dca25f0e8c1
Reviewed-on: https://go-review.googlesource.com/c/go/+/453258
Auto-Submit: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
src/cmd/api/api.go [moved from src/cmd/api/goapi.go with 91% similarity]
src/cmd/api/api_test.go [moved from src/cmd/api/goapi_test.go with 87% similarity]
src/cmd/api/boring_test.go [moved from src/cmd/api/goapi_boring_test.go with 95% similarity]
src/cmd/api/run.go [deleted file]
src/cmd/dist/test.go