]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: use current go source code when generating doc.go
authorAndrew Gerrand <adg@golang.org>
Tue, 10 Feb 2015 02:24:47 +0000 (13:24 +1100)
committerGerrit Code Review <noreply-gerritcodereview@google.com>
Tue, 10 Feb 2015 02:31:27 +0000 (02:31 +0000)
Change-Id: Iad1764707d173a09467fd36e8c49a58147f12219
Reviewed-on: https://go-review.googlesource.com/4320
Reviewed-by: Minux Ma <minux@golang.org>
src/cmd/go/doc.go
src/cmd/go/mkdoc.sh

index 398f83d113b2126ea517e1f866db0c4d4cab0160..5bf089df0aed36447ba29dc0d678c423b622e2c6 100644 (file)
@@ -310,6 +310,7 @@ The generator is run in the package's source directory.
 Go generate accepts one specific flag:
 
        -run=""
+               TODO: This flag is unimplemented.
                if non-empty, specifies a regular expression to
                select directives whose command matches the expression.
 
index e15e8809ce331b7c9c01c3413bcbb8d4720bc6f1..507a8aeddc8a752dac08e13ad21c387225d683dd 100755 (executable)
@@ -1,9 +1,12 @@
-#!/bin/sh
+#!/bin/bash
 # Copyright 2012 The Go Authors.  All rights reserved.
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-go install # So the next line will produce updated documentation.
-go help documentation | sed 's; \*/; * /;' >doc.go
+set -e
+
+go build -o go.latest
+./go.latest help documentation | sed 's; \*/; * /;' >doc.go
 gofmt -w doc.go
+rm go.latest