// version returns the application version as a properly formed string per the
// semantic versioning 2.0.0 spec (http://semver.org/).
965882
func version() string {
	// Start with the major, minor, and patch versions.
	version := fmt.Sprintf("%d.%d.%d", appMajor, appMinor, appPatch)

	// Append pre-release version if there is one.  The hyphen called for
	// by the semantic versioning spec is automatically appended and should
	// not be contained in the pre-release string.  The pre-release version
	// is not appended if it contains invalid characters.
	preRelease := normalizeVerString(appPreRelease)
	if preRelease != "" {
		version = fmt.Sprintf("%s-%s", version, preRelease)
	}

	// Append build metadata if there is any.  The plus called for
	// by the semantic versioning spec is automatically appended and should
	// not be contained in the build metadata string.  The build metadata
	// string is not appended if it contains invalid characters.
	build := normalizeVerString(appBuild)
	if build != "" {
		version = fmt.Sprintf("%s+%s", version, build)
	}

	return version
}
1281026
func (sc *Client) Version(ctx context.Context) (string, error) {
	var result string
	err := sc.c.CallContext(ctx, &result, "shh_version")
	return result, err
}
1326659
func Version() string {
	b, _ := ioutil.ReadFile("../VERSION")
	v := string(b)
	return v
}
116076
func (g *GPG) Version(context.Context) semver.Version {
	return semver.Version{Major: 1}
}
828156
func (d *Vagrant_2_2_Driver) Version() (string, error) {
	stdoutString, _, err := d.vagrantCmd([]string{"--version"}...)
	// Example stdout:

	// 	Installed Version: 2.2.3
	//
	// Vagrant was unable to check for the latest version of Vagrant.
	// Please check manually at https://www.vagrantup.com

	// Use regex to find version
	reg := regexp.MustCompile(`(\d+\.)?(\d+\.)?(\*|\d+)`)
	version := reg.FindString(stdoutString)
	if version == "" {
		return "", err
	}

	return version, nil
}
931121
func (s *SearchSource) Version(version bool) *SearchSource {
	s.version = &version
	return s
}
1286201
func (d *DevTools) Version(ctx context.Context) (*Version, error) {
	resp, err := d.httpGet(ctx, "/json/version")
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()

	if resp.StatusCode != http.StatusOK {
		return nil, parseError("Version", resp.Body)
	}

	v := new(Version)
	return v, json.NewDecoder(resp.Body).Decode(&v)
}
486005
func (s *session) version() *version {
	s.vmu.Lock()
	defer s.vmu.Unlock()
	s.stVersion.incref()
	return s.stVersion
}
1220139
func (v *Version) String() string {
	return fmt.Sprintf(
		`Version{Name: %v, Version: %v, Platform: %v, Architecture: %v}`,
		v.Name, v.Version, v.Platform, v.Architecture)
}
1232854
func VERSION(v *Version) {
	v.Major = MAJOR_VERSION
	v.Minor = MINOR_VERSION
	v.Patch = PATCHLEVEL
}
52315
func (linux Linux) Version() string {
	if len(linux.lsbrelease) == 0 {
		return ""
	}

	rVersion := regexp.MustCompile(versionPattern)
	return rVersion.FindAllStringSubmatch(linux.lsbrelease, 1)[0][1]
}
759686
func (s *PutTemplateService) Version(version int) *PutTemplateService {
	s.version = &version
	return s
}
1120872
func Version(name string, url string, kvdbOptions map[string]string) (string, error) {
	lock.RLock()
	defer lock.RUnlock()

	if dsVersion, exists := datastoreVersions[name]; exists {
		return dsVersion(url, kvdbOptions)
	}
	return "", ErrNotSupported
}
895314
func Version() (major, minor, patch int, s string) {
	var maj, min, pat C.int
	verstr := C.mdb_version(&maj, &min, &pat)
	return int(maj), int(min), int(pat), C.GoString(verstr)
}
700759
func (svc *Service) Version() string {
	parts := strings.Split(svc.Image, ":")
	if len(parts) > 1 {
		return parts[1]
	}

	return parts[0]
}
803761
func (s *DeleteTemplateService) Version(version int) *DeleteTemplateService {
	s.version = &version
	return s
}
851386
func (c *Client) Version(ctx context.Context) (Version, error) {
	c.connMu.Lock()
	if c.conn == nil {
		c.connMu.Unlock()
		return Version{}, errors.New("no grpc connection available")
	}
	c.connMu.Unlock()
	response, err := c.VersionService().Version(ctx, &ptypes.Empty{})
	if err != nil {
		return Version{}, err
	}
	return Version{
		Version:  response.Version,
		Revision: response.Revision,
	}, nil
}