]> Cypherpunks repositories - gostls13.git/commit
cmd/go: convert mkalldocs.sh to a Go program
authorBryan C. Mills <bcmills@google.com>
Wed, 15 Feb 2023 21:45:14 +0000 (16:45 -0500)
committerGopher Robot <gobot@golang.org>
Mon, 27 Feb 2023 21:45:11 +0000 (21:45 +0000)
commit676794f73e6ca8fbd7ec14f4185625efda4e2ca8
tree8643cd08876754981f5a7a13c2032ca206c4b29f
parent85d54a7667c12ea2320f43b24129a68f020ac095
cmd/go: convert mkalldocs.sh to a Go program

mkalldocs.sh required a Unix shell, making it less accessible for
contributors on Windows. It also used a substantially different
codepath to regenerate the file than the one used to check the file
for staleness, making failures in TestDocsUpToDate more complex to
diagnose.

We can solve both of those problems by using the same technique as in
checkScriptReadme: use the test itself as the generator to update the
file. The test is already written in Go, the test binary already knows
how to mimic the 'go' command, and this approach brings the difference
between the test and the generator down to a single flag check.

Updates #26735.

Change-Id: I7c6f65cb0e0c29e334e38a45412e0a73c4d31d42
Reviewed-on: https://go-review.googlesource.com/c/go/+/468636
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
src/cmd/go/alldocs.go
src/cmd/go/help_test.go
src/cmd/go/internal/help/help.go
src/cmd/go/main.go
src/cmd/go/mkalldocs.sh [deleted file]