Skip to content
Permalink
Browse files

internal/testenv: introduce IsWindowsXP

For #23072

Change-Id: I089feafef2900413d46f2358b6e41ab78187eced
Reviewed-on: https://go-review.googlesource.com/83076
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
  • Loading branch information...
alexbrainman authored and bradfitz committed Dec 9, 2017
1 parent b3a1088 commit d038da73bde46d241d7851428e4712350a2b46a2
Showing with 13 additions and 0 deletions.
  1. +4 −0 src/internal/testenv/testenv_notwin.go
  2. +9 −0 src/internal/testenv/testenv_windows.go
@@ -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
}

0 comments on commit d038da7

Please sign in to comment.
You can’t perform that action at this time.