20 lines
492 B
Go
20 lines
492 B
Go
package windows
|
|
|
|
import "fmt"
|
|
|
|
func versionSupports(minOS string, major, minor, build, servicePack uint32) (bool, error) {
|
|
switch minOS {
|
|
case "windows-7-sp1":
|
|
if major > 6 || (major == 6 && minor > 1) {
|
|
return true, nil
|
|
}
|
|
return major == 6 && minor == 1 && servicePack >= 1, nil
|
|
case "windows-10":
|
|
return major >= 10, nil
|
|
case "windows-11":
|
|
return major >= 10 && build >= 22000, nil
|
|
default:
|
|
return false, fmt.Errorf("unsupported minimum Windows release %q", minOS)
|
|
}
|
|
}
|