github.com/bir3/gocompiler@v0.9.2202/src/cmd/internal/osinfo/os_windows.go (about)

     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  
    12  	"github.com/bir3/gocompiler/src/xvendor/golang.org/x/sys/windows"
    13  )
    14  
    15  // Version returns the OS version name/number.
    16  func Version() (string, error) {
    17  	major, minor, patch := windows.RtlGetNtVersionNumbers()
    18  	return fmt.Sprintf("%d.%d.%d", major, minor, patch), nil
    19  }