aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/osinfo/os_plan9.go
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2021-12-13 17:34:16 -0500
committerMichael Pratt <mpratt@google.com>2022-03-08 21:35:38 +0000
commitdbbe4cca5d7069482983316694334bdf2fe6a7ec (patch)
tree31b5e23d4d104fdcb65b2cca9dcfdf9967d28424 /src/cmd/internal/osinfo/os_plan9.go
parent67f1a436b9c4055e02d9d031c6c2e9d6c9456bf0 (diff)
downloadgo-dbbe4cca5d7069482983316694334bdf2fe6a7ec.tar.gz
go-dbbe4cca5d7069482983316694334bdf2fe6a7ec.zip
cmd/dist: log OS version when testing
As a follow-up to https://golang.org/cl/371474, add the OS version to the metadata printed for each test. This is a redo of CL 371475. This version updates go.mod and conforms to the changes made in the parent commit. Fixes #50146. Change-Id: Iba5541cc8dd2c85c1fa3a215e30c8c3f9b6aaaab Reviewed-on: https://go-review.googlesource.com/c/go/+/378590 Reviewed-by: Austin Clements <austin@google.com> Trust: Michael Pratt <mpratt@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/cmd/internal/osinfo/os_plan9.go')
-rw-r--r--src/cmd/internal/osinfo/os_plan9.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/cmd/internal/osinfo/os_plan9.go b/src/cmd/internal/osinfo/os_plan9.go
new file mode 100644
index 0000000000..e0225a93a2
--- /dev/null
+++ b/src/cmd/internal/osinfo/os_plan9.go
@@ -0,0 +1,21 @@
+// Copyright 2022 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:build plan9
+
+package osinfo
+
+import (
+ "os"
+)
+
+// Version returns the OS version name/number.
+func Version() (string, error) {
+ b, err := os.ReadFile("/dev/osversion")
+ if err != nil {
+ return "", err
+ }
+
+ return string(b), nil
+}