// GetVersion returns a semver.Version object by querying /info
10981
func (c *ClusterInfo) GetVersion(addr string) (semver.Version, error) {
	endpoint := fmt.Sprintf("http://%s/info", addr)
	var resp struct {
		Version string `json:"version"`
	}
	err := c.client.GETV1(endpoint, &resp)
	if err != nil {
		return semver.Version{}, err
	}
	if resp.Version == "" {
		resp.Version = "unknown"
	}
	return semver.Parse(resp.Version)
}
394795
func (st *MemStorage) GetVersion(gun data.GUN, role data.RoleName, version int) (*time.Time, []byte, error) {
	st.lock.Lock()
	defer st.lock.Unlock()

	id := entryKey(gun, role)
	for _, ver := range st.tufMeta[id] {
		if ver.version == version {
			return &(ver.createupdate), ver.data, nil
		}
	}

	return nil, nil, ErrNotFound{}
}
1129093
func getVersion() string {
	slurp, err := ioutil.ReadFile(filepath.Join(camliDir, "VERSION"))
	if err == nil {
		return strings.TrimSpace(string(slurp))
	}
	return gitVersion()
}
193510
func (x *XC) Version(ctx context.Context) semver.Version {
	return semver.Version{
		Patch: 1,
	}
}
46886
func GetVersions() []Version {
	v := []Version{}
	for k := range tarSumVersions {
		v = append(v, k)
	}
	return v
}
1328358
func (n *NetworkServerAPI) GetVersion(ctx context.Context, req *empty.Empty) (*ns.GetVersionResponse, error) {
	region, ok := map[string]common.Region{
		common.Region_AS923.String(): common.Region_AS923,
		common.Region_AU915.String(): common.Region_AU915,
		common.Region_CN470.String(): common.Region_CN470,
		common.Region_CN779.String(): common.Region_CN779,
		common.Region_EU433.String(): common.Region_EU433,
		common.Region_EU868.String(): common.Region_EU868,
		common.Region_IN865.String(): common.Region_IN865,
		common.Region_KR920.String(): common.Region_KR920,
		common.Region_RU864.String(): common.Region_RU864,
		common.Region_US915.String(): common.Region_US915,
	}[band.Band().Name()]

	if !ok {
		log.WithFields(log.Fields{
			"band_name": band.Band().Name(),
		}).Warning("unknown band to common name mapping")
	}

	return &ns.GetVersionResponse{
		Region:  region,
		Version: config.Version,
	}, nil
}
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)]))
}
19340
func (f FileVersion) GetVersionString() string {
	return fmt.Sprintf("%d.%d.%d.%d", f.Major, f.Minor, f.Patch, f.Build)
}
818100
func parseVersion(v string) (semver.Version, error) {
	parts := strings.Split(v, ".")
	var err error
	for i := len(parts); i > 0; i-- {
		var ver semver.Version
		ver, err = semver.ParseTolerant(strings.Join(parts[:i], "."))
		if err == nil {
			return ver, nil
		}
	}
	return semver.Version{}, err
}
804480
func GetSemverVersion() (semver.Version, error) {
	return semver.Make(strings.TrimPrefix(GetVersion(), VersionPrefix))
}
665493
func Get() (*Version, error) {
	// Run the get_version script.
	stdout, err := scripts.Run(scripts.ScriptNameGetVersion)
	if err != nil {
		return nil, err
	}

	// Parse the output and return the version.
	return Parse(strings.TrimSpace(stdout.String()))
}
83164
func (m *InMem) Version(context.Context) semver.Version {
	return semver.Version{Major: 1}
}
1190398
func (tree *MutableTree) GetVersioned(key []byte, version int64) (
	index int64, value []byte,
) {
	if tree.versions[version] {
		t, err := tree.GetImmutable(version)
		if err != nil {
			return -1, nil
		}
		return t.Get(key)
	}
	return -1, nil
}
286252
func (wc *WhisperClient) GetVersion(ctx *Context) (version string, _ error) {
	return wc.client.Version(ctx.context)
}
1137471
func getDBVersion(tx *sql.Tx) (int, error) {
	var version int
	rows, err := tx.Query("SELECT version FROM version")
	if err != nil {
		return -1, err
	}
	defer rows.Close()
	found := false
	for rows.Next() {
		if err := rows.Scan(&version); err != nil {
			return -1, err
		}
		found = true
		break
	}
	if err := rows.Err(); err != nil {
		return -1, err
	}
	if !found {
		return -1, fmt.Errorf("db version table empty")
	}
	return version, nil
}
864674
func (s *VersionService) Get(versionID int) (*Version, *Response, error) {
	apiEndpoint := fmt.Sprintf("/rest/api/2/version/%v", versionID)
	req, err := s.client.NewRequest("GET", apiEndpoint, nil)
	if err != nil {
		return nil, nil, err
	}

	version := new(Version)
	resp, err := s.client.Do(req, version)
	if err != nil {
		return nil, resp, NewJiraError(resp, err)
	}
	return version, resp, nil
}
302698
func GetKernelVersion() (*VersionInfo, error) {
	release, err := getRelease()
	if err != nil {
		return nil, err
	}

	return ParseRelease(release)
}