// GetOSVersion gets the operating system version on Windows. Note that
// docker.exe must be manifested to get the correct version information.
439076
func GetOSVersion() OSVersion {
	var err error
	osv := OSVersion{}
	osv.Version, err = windows.GetVersion()
	if err != nil {
		// GetVersion never fails.
		panic(err)
	}
	osv.MajorVersion = uint8(osv.Version & 0xFF)
	osv.MinorVersion = uint8(osv.Version >> 8 & 0xFF)
	osv.Build = uint16(osv.Version >> 16)
	return osv
}
19340
func (f FileVersion) GetVersionString() string {
	return fmt.Sprintf("%d.%d.%d.%d", f.Major, f.Minor, f.Patch, f.Build)
}
384068
func (p GatewayProfile) GetVersion() string {
	return p.UpdatedAt.UTC().Format(time.RFC3339Nano)
}
719192
func getIPVersion(config *networkConfiguration) ipVersion {
	ipVersion := ipv4
	if config.AddressIPv6 != nil || config.EnableIPv6 {
		ipVersion |= ipv6
	}
	return ipVersion
}
73158
func getBootstrapVersion(s Session) (int64, error) {
	sVal, isNull, err := getTiDBVar(s, tidbServerVersionVar)
	if err != nil {
		return 0, errors.Trace(err)
	}
	if isNull {
		return 0, nil
	}
	return strconv.ParseInt(sVal, 10, 64)
}
159355
func GetVersion() Version {
	var versionStr string
	if gitCommit != "" && gitTag != "" && gitTreeState == "clean" {
		// if we have a clean tree state and the current commit is tagged,
		// this is an official release.
		versionStr = gitTag
	} else {
		// otherwise formulate a version string based on as much metadata
		// information we have available.
		versionStr = "v" + version
		if len(gitCommit) >= 7 {
			versionStr += "+" + gitCommit[0:7]
			if gitTreeState != "clean" {
				versionStr += ".dirty"
			}
		} else {
			versionStr += "+unknown"
		}
	}
	return Version{
		Version:      versionStr,
		BuildDate:    buildDate,
		GitCommit:    gitCommit,
		GitTag:       gitTag,
		GitTreeState: gitTreeState,
		GoVersion:    runtime.Version(),
		Compiler:     runtime.Compiler,
		Platform:     fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH),
	}
}
1322535
func (o *KernelValidatorHelperImpl) GetKernelReleaseVersion() (string, error) {
	args := []string{"(Get-CimInstance Win32_OperatingSystem).Version"}
	releaseVersion, err := exec.Command("powershell", args...).Output()
	if err != nil {
		return "", err
	}
	return strings.TrimSpace(string(releaseVersion)), nil
}
761773
func (ds *dockerService) Version(_ context.Context, r *runtimeapi.VersionRequest) (*runtimeapi.VersionResponse, error) {
	v, err := ds.getDockerVersion()
	if err != nil {
		return nil, err
	}
	return &runtimeapi.VersionResponse{
		Version:           kubeAPIVersion,
		RuntimeName:       dockerRuntimeName,
		RuntimeVersion:    v.Version,
		RuntimeApiVersion: v.APIVersion,
	}, nil
}
622518
func (c *Connect) GetVersion() (uint32, error) {
	var hvVer C.ulong
	var err C.virError
	ret := C.virConnectGetVersionWrapper(c.ptr, &hvVer, &err)
	if ret == -1 {
		return 0, makeError(&err)
	}

	return uint32(hvVer), nil
}
566041
func GetVersions(property *Property) (*Versions, error) {
	versions := NewVersions()
	if err := versions.GetVersions(property); err != nil {
		return nil, err
	}

	return versions, nil
}
1347783
func GetDockerVersion() ([]int, error) {
	dc, err := docker.NewClient()
	if err != nil {
		return nil, err
	}
	env, err := dc.Version()
	if err != nil {
		return nil, err
	}
	versionString := env.Get("Version")
	versionSplit := strings.Split(versionString, ".")
	version := make([]int, len(versionSplit))
	for i, v := range versionSplit {
		n, err := strconv.Atoi(v)
		if err != nil {
			return nil, err
		}
		version[i] = n
	}
	return version, nil
}
565921
func (v *VersionClient) Get(ctx context.Context) (*apitypes.Version, error) {
	version := apitypes.Version{}
	err := v.client.RoundTrip(ctx, "GET", "/version", nil, nil, &version)
	return &version, err
}
957319
func (c *Browser) GetVersion() (string, string, string, string, string, error) {
	resp, err := gcdmessage.SendCustomReturn(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Browser.getVersion"})
	if err != nil {
		return "", "", "", "", "", err
	}

	var chromeData struct {
		Result struct {
			ProtocolVersion string
			Product         string
			Revision        string
			UserAgent       string
			JsVersion       string
		}
	}

	if resp == nil {
		return "", "", "", "", "", &gcdmessage.ChromeEmptyResponseErr{}
	}

	// test if error first
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return "", "", "", "", "", &gcdmessage.ChromeRequestErr{Resp: cerr}
	}

	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return "", "", "", "", "", err
	}

	return chromeData.Result.ProtocolVersion, chromeData.Result.Product, chromeData.Result.Revision, chromeData.Result.UserAgent, chromeData.Result.JsVersion, nil
}
883710
func getVersion(w http.ResponseWriter, r *http.Request) {
	ver := version.Get()

	resp, err := json.Marshal(ver)
	if err != nil {
		http.Error(w,
			core.Errorf("marshaling json failed. Error: %s", err).Error(),
			http.StatusInternalServerError)
		return
	}
	w.Write(resp)
	return
}
8206
func GetGroupVersion(group, version string) string {
	if len(group) == 0 {
		return version
	}
	return group + "/" + version
}
1177007
func GetKernelVersion() (*VersionInfo, error) {
	uts, err := uname()
	if err != nil {
		return nil, err
	}

	// Remove the \x00 from the release for Atoi to parse correctly
	return ParseRelease(string(uts.Release[:bytes.IndexByte(uts.Release[:], 0)]))
}
286252
func (wc *WhisperClient) GetVersion(ctx *Context) (version string, _ error) {
	return wc.client.Version(ctx.context)
}