src/cmd/internal/osinfo/os_windows.go
raw| 1 | // Copyright 2022 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | //go:build windows |
| 6 | |
| 7 | package osinfo |
| 8 | |
| 9 | import ( |
| 10 | "fmt" |
| 11 | "internal/syscall/windows" |
| 12 | ) |
| 13 | |
| 14 | // Version returns the OS version name/number. |
| 15 | func Version() (string, error) { |
| 16 | major, minor, build := windows.Version() |
| 17 | return fmt.Sprintf("%d.%d.%d", major, minor, build), nil |
| 18 | } |