1
0
mirror of https://github.com/golang/go synced 2024-11-19 15:54:46 -07:00

internal/testenv: introduce IsWindowsXP

For #23072

Change-Id: I089feafef2900413d46f2358b6e41ab78187eced
Reviewed-on: https://go-review.googlesource.com/83076
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Alex Brainman 2017-12-10 10:14:41 +11:00 committed by Brad Fitzpatrick
parent b3a108879f
commit d038da73bd
2 changed files with 13 additions and 0 deletions

View File

@ -18,3 +18,7 @@ func hasSymlink() (ok bool, reason string) {
return true, ""
}
func IsWindowsXP() bool {
return false
}

View File

@ -46,3 +46,12 @@ func hasSymlink() (ok bool, reason string) {
return false, ""
}
func IsWindowsXP() bool {
v, err := syscall.GetVersion()
if err != nil {
panic("GetVersion failed: " + err.Error())
}
major := byte(v)
return major < 6
}