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:
parent
b3a108879f
commit
d038da73bd
@ -18,3 +18,7 @@ func hasSymlink() (ok bool, reason string) {
|
||||
|
||||
return true, ""
|
||||
}
|
||||
|
||||
func IsWindowsXP() bool {
|
||||
return false
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user