veyron/*/main.go: update go:generate to use tool
Use the veyron doc.go generator program to generate doc.go files for
commands so that go:generate operates correctly when there are unit
test source files in the same directory per:
https://github.com/veyron/release-issues/issues/389
Change-Id: I84b0a07a59b591b87717276a8528224c88d6021f
diff --git a/tools/application/main.go b/tools/application/main.go
index a99a159..6bf723d 100644
--- a/tools/application/main.go
+++ b/tools/application/main.go
@@ -1,11 +1,5 @@
// The following enables go generate to generate the doc.go file.
-// Things to look out for:
-// 1) go:generate evaluates double-quoted strings into a single argument.
-// 2) go:generate performs $NAME expansion, so the bash cmd can't contain '$'.
-// 3) We generate into a *.tmp file first, otherwise go run will pick up the
-// initially empty *.go file, and fail.
-//
-//go:generate bash -c "{ echo -e '// This file was auto-generated via go generate.\n// DO NOT UPDATE MANUALLY\n\n/*' && veyron go run *.go help -style=godoc ... && echo -e '*/\npackage main'; } > ./doc.go.tmp && mv ./doc.go.tmp ./doc.go"
+//go:generate go run $VEYRON_ROOT/tools/go/src/tools/lib/cmdline/testdata/gendoc.go .
package main
diff --git a/tools/binary/main.go b/tools/binary/main.go
index a99a159..6bf723d 100644
--- a/tools/binary/main.go
+++ b/tools/binary/main.go
@@ -1,11 +1,5 @@
// The following enables go generate to generate the doc.go file.
-// Things to look out for:
-// 1) go:generate evaluates double-quoted strings into a single argument.
-// 2) go:generate performs $NAME expansion, so the bash cmd can't contain '$'.
-// 3) We generate into a *.tmp file first, otherwise go run will pick up the
-// initially empty *.go file, and fail.
-//
-//go:generate bash -c "{ echo -e '// This file was auto-generated via go generate.\n// DO NOT UPDATE MANUALLY\n\n/*' && veyron go run *.go help -style=godoc ... && echo -e '*/\npackage main'; } > ./doc.go.tmp && mv ./doc.go.tmp ./doc.go"
+//go:generate go run $VEYRON_ROOT/tools/go/src/tools/lib/cmdline/testdata/gendoc.go .
package main
diff --git a/tools/build/main.go b/tools/build/main.go
index a99a159..6bf723d 100644
--- a/tools/build/main.go
+++ b/tools/build/main.go
@@ -1,11 +1,5 @@
// The following enables go generate to generate the doc.go file.
-// Things to look out for:
-// 1) go:generate evaluates double-quoted strings into a single argument.
-// 2) go:generate performs $NAME expansion, so the bash cmd can't contain '$'.
-// 3) We generate into a *.tmp file first, otherwise go run will pick up the
-// initially empty *.go file, and fail.
-//
-//go:generate bash -c "{ echo -e '// This file was auto-generated via go generate.\n// DO NOT UPDATE MANUALLY\n\n/*' && veyron go run *.go help -style=godoc ... && echo -e '*/\npackage main'; } > ./doc.go.tmp && mv ./doc.go.tmp ./doc.go"
+//go:generate go run $VEYRON_ROOT/tools/go/src/tools/lib/cmdline/testdata/gendoc.go .
package main
diff --git a/tools/debug/main.go b/tools/debug/main.go
index a99a159..6bf723d 100644
--- a/tools/debug/main.go
+++ b/tools/debug/main.go
@@ -1,11 +1,5 @@
// The following enables go generate to generate the doc.go file.
-// Things to look out for:
-// 1) go:generate evaluates double-quoted strings into a single argument.
-// 2) go:generate performs $NAME expansion, so the bash cmd can't contain '$'.
-// 3) We generate into a *.tmp file first, otherwise go run will pick up the
-// initially empty *.go file, and fail.
-//
-//go:generate bash -c "{ echo -e '// This file was auto-generated via go generate.\n// DO NOT UPDATE MANUALLY\n\n/*' && veyron go run *.go help -style=godoc ... && echo -e '*/\npackage main'; } > ./doc.go.tmp && mv ./doc.go.tmp ./doc.go"
+//go:generate go run $VEYRON_ROOT/tools/go/src/tools/lib/cmdline/testdata/gendoc.go .
package main
diff --git a/tools/mgmt/nodex/main.go b/tools/mgmt/nodex/main.go
index b3c5b7b..6bf723d 100644
--- a/tools/mgmt/nodex/main.go
+++ b/tools/mgmt/nodex/main.go
@@ -1,13 +1,5 @@
// The following enables go generate to generate the doc.go file.
-// Things to look out for:
-// 1) go:generate evaluates double-quoted strings into a single argument.
-// 2) go:generate performs $NAME expansion, so the bash cmd can't contain '$'.
-// 3) We generate into a *.tmp file first, otherwise go run will pick up the
-// initially empty *.go file, and fail.
-// TODO(rjkroege): The below fails because _test.go files are present. Fix this.
-// An alternative in Sam/Acme: Edit /\/\*/+1, /\*\//-1 <./nodex help -style'='godoc ...
-//
-//go:generate bash -c "{ echo -e '// This file was auto-generated via go generate.\n// DO NOT UPDATE MANUALLY\n\n/*' && veyron go run *.go help -style=godoc ... && echo -e '*/\npackage main'; } > ./doc.go.tmp && mv ./doc.go.tmp ./doc.go"
+//go:generate go run $VEYRON_ROOT/tools/go/src/tools/lib/cmdline/testdata/gendoc.go .
package main
diff --git a/tools/mounttable/main.go b/tools/mounttable/main.go
index a99a159..6bf723d 100644
--- a/tools/mounttable/main.go
+++ b/tools/mounttable/main.go
@@ -1,11 +1,5 @@
// The following enables go generate to generate the doc.go file.
-// Things to look out for:
-// 1) go:generate evaluates double-quoted strings into a single argument.
-// 2) go:generate performs $NAME expansion, so the bash cmd can't contain '$'.
-// 3) We generate into a *.tmp file first, otherwise go run will pick up the
-// initially empty *.go file, and fail.
-//
-//go:generate bash -c "{ echo -e '// This file was auto-generated via go generate.\n// DO NOT UPDATE MANUALLY\n\n/*' && veyron go run *.go help -style=godoc ... && echo -e '*/\npackage main'; } > ./doc.go.tmp && mv ./doc.go.tmp ./doc.go"
+//go:generate go run $VEYRON_ROOT/tools/go/src/tools/lib/cmdline/testdata/gendoc.go .
package main
diff --git a/tools/namespace/main.go b/tools/namespace/main.go
index a99a159..6bf723d 100644
--- a/tools/namespace/main.go
+++ b/tools/namespace/main.go
@@ -1,11 +1,5 @@
// The following enables go generate to generate the doc.go file.
-// Things to look out for:
-// 1) go:generate evaluates double-quoted strings into a single argument.
-// 2) go:generate performs $NAME expansion, so the bash cmd can't contain '$'.
-// 3) We generate into a *.tmp file first, otherwise go run will pick up the
-// initially empty *.go file, and fail.
-//
-//go:generate bash -c "{ echo -e '// This file was auto-generated via go generate.\n// DO NOT UPDATE MANUALLY\n\n/*' && veyron go run *.go help -style=godoc ... && echo -e '*/\npackage main'; } > ./doc.go.tmp && mv ./doc.go.tmp ./doc.go"
+//go:generate go run $VEYRON_ROOT/tools/go/src/tools/lib/cmdline/testdata/gendoc.go .
package main
diff --git a/tools/profile/main.go b/tools/profile/main.go
index a99a159..6bf723d 100644
--- a/tools/profile/main.go
+++ b/tools/profile/main.go
@@ -1,11 +1,5 @@
// The following enables go generate to generate the doc.go file.
-// Things to look out for:
-// 1) go:generate evaluates double-quoted strings into a single argument.
-// 2) go:generate performs $NAME expansion, so the bash cmd can't contain '$'.
-// 3) We generate into a *.tmp file first, otherwise go run will pick up the
-// initially empty *.go file, and fail.
-//
-//go:generate bash -c "{ echo -e '// This file was auto-generated via go generate.\n// DO NOT UPDATE MANUALLY\n\n/*' && veyron go run *.go help -style=godoc ... && echo -e '*/\npackage main'; } > ./doc.go.tmp && mv ./doc.go.tmp ./doc.go"
+//go:generate go run $VEYRON_ROOT/tools/go/src/tools/lib/cmdline/testdata/gendoc.go .
package main
diff --git a/tools/vrpc/main.go b/tools/vrpc/main.go
index 3c2043c..a9d4563 100644
--- a/tools/vrpc/main.go
+++ b/tools/vrpc/main.go
@@ -1,11 +1,5 @@
// The following enables go generate to generate the doc.go file.
-// Things to look out for:
-// 1) go:generate evaluates double-quoted strings into a single argument.
-// 2) go:generate performs $NAME expansion, so the bash cmd can't contain '$'.
-// 3) We generate into a *.tmp file first, otherwise go run will pick up the
-// initially empty *.go file, and fail.
-//
-//go:generate bash -c "{ echo -e '// This file was auto-generated via go generate.\n// DO NOT UPDATE MANUALLY\n\n/*' && veyron go run *.go help -style=godoc ... && echo -e '*/\npackage main'; } > ./doc.go.tmp && mv ./doc.go.tmp ./doc.go"
+//go:generate go run $VEYRON_ROOT/tools/go/src/tools/lib/cmdline/testdata/gendoc.go .
package main