aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/version.txt
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2019-04-22 23:30:03 -0400
committerRuss Cox <rsc@golang.org>2019-04-26 13:52:01 +0000
commit216797b63bb3d2f54c32a968d63857d75895113e (patch)
treef5ba2110eb0bd4faf83b2750ce356394675f9762 /src/cmd/go/testdata/script/version.txt
parentd6b06f025475d62c9d4615d23b463af4395b0c23 (diff)
downloadgo-216797b63bb3d2f54c32a968d63857d75895113e.tar.gz
go-216797b63bb3d2f54c32a968d63857d75895113e.zip
cmd/go: make 'go version' apply to files
Expand "go version" from printing just the version of the go command itself to being able to print the version of any go binary (when listed on the command line). This is a simplified version of rsc.io/goversion, which will now be deprecated in favor of "go version". (Preparatory changes to runtime, cmd/go, and cmd/link made this version information easier to find, allowing a much simpler implementation than in rsc.io/goversion.) Fixes #31624. Change-Id: I5f6f5b8392ce86a617e32ce287f6bf2aceafccff Reviewed-on: https://go-review.googlesource.com/c/go/+/173343 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src/cmd/go/testdata/script/version.txt')
-rw-r--r--src/cmd/go/testdata/script/version.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/cmd/go/testdata/script/version.txt b/src/cmd/go/testdata/script/version.txt
new file mode 100644
index 0000000000..84cb23a362
--- /dev/null
+++ b/src/cmd/go/testdata/script/version.txt
@@ -0,0 +1,10 @@
+env GO111MODULE=on
+go build -o fortune.exe rsc.io/fortune
+go version fortune.exe
+stdout '^fortune.exe: .+'
+go version -m fortune.exe
+stdout '^\tpath\trsc.io/fortune'
+stdout '^\tmod\trsc.io/fortune\tv1.0.0'
+
+-- go.mod --
+module m