mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/go: add test checking version with experiment is valid
For #75953 Change-Id: I6a6a69645d6d2af9be1b076f2460cdb295ea3c6e Reviewed-on: https://go-review.googlesource.com/c/go/+/720600 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Junyang Shao <shaojunyang@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
f22d37d574
commit
c5c05a0e43
1 changed files with 10 additions and 2 deletions
|
|
@ -12,5 +12,13 @@ stderr 'X:fieldtrack$'
|
|||
|
||||
-- version.go --
|
||||
package main
|
||||
import "runtime"
|
||||
func main() { println(runtime.Version()) }
|
||||
import (
|
||||
"go/version"
|
||||
"runtime"
|
||||
)
|
||||
func main() {
|
||||
if !version.IsValid(runtime.Version()) {
|
||||
panic("version not valid: "+runtime.Version())
|
||||
}
|
||||
println(runtime.Version())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue