// lastSemanticVersion attempts to return a semantic version from the GitVersion - which
// is either <semver>+<commit> or <semver> on release boundaries.
776430
func lastSemanticVersionWithoutModifiers(version string) string {
	parts := strings.Split(version, "-")
	return strings.Split(parts[0], "+")[0]
}
180985
func Version(buildVer, buildDate, commitHash string) Option {
	return func(o *Options) {
		BuildVersion = buildVer
		BuildDate = buildDate
		CommitHash = commitHash
	}
}
396094
func (item *MultiGetItem) Version(version int64) *MultiGetItem {
	item.version = &version
	return item
}
222890
func (g *BuildGenerator) checkLastVersion(bc *buildv1.BuildConfig, lastVersion *int64) error {
	if lastVersion != nil && bc.Status.LastVersion != *lastVersion {
		klog.V(2).Infof("Aborting version triggered build for BuildConfig %s/%s because the BuildConfig LastVersion (%d) does not match the requested LastVersion (%d)", bc.Namespace, bc.Name, bc.Status.LastVersion, *lastVersion)
		return fmt.Errorf("the LastVersion(%v) on build config %s/%s does not match the build request LastVersion(%d)",
			bc.Status.LastVersion, bc.Namespace, bc.Name, *lastVersion)
	}
	return nil
}
101374
func Version(url string, kvdbOptions map[string]string) (string, error) {
	return kvdb.ZookeeperVersion1, nil
}
1259333
func (c *BasicClient) Version() String {
	if len(c.AppVer) > 0 {
		return String(c.AppVer)
	}
	return String("0001")
}
1134832
func GetHumanVersion() string {
	version := Version
	if GitDescribe != "" {
		version = GitDescribe
	}

	release := VersionPrerelease
	if GitDescribe == "" && release == "" {
		release = "dev"
	}

	if release != "" {
		if !strings.HasSuffix(version, "-"+release) {
			// if we tagged a prerelease version then the release is in the version already
			version += fmt.Sprintf("-%s", release)
		}
		if GitCommit != "" {
			version += fmt.Sprintf(" (%s)", GitCommit)
		}
	}

	// Strip off any single quotes added by the git information.
	return strings.Replace(version, "'", "", -1)
}
453878
func (c *syncClient) Lastsave() (result int64, err Error) {
	var resp Response
	resp, err = c.conn.ServiceRequest(&LASTSAVE, [][]byte{})
	if err == nil {
		result = resp.GetNumberValue()
	}
	return result, err

}
98398
func (s *PublicEthereumAPI) ProtocolVersion() hexutil.Uint {
	return hexutil.Uint(s.b.ProtocolVersion())
}
503870
func (n *managedNode) UpgradeSoftwareVersion(version string) (bool, error) {
	n.Lock()
	defer n.Unlock()
	ctx, _ := context.WithTimeout(context.Background(), DEFAULT_CTX_TIMEOUT)
	status, err := n.client.SelfUpgrade(ctx, &cc.SelfUpgradeMsg{Version: version})
	return status.Status, err
}
524807
func (n *managedNode) GetSoftwareVersion() (string, error) {
	n.RLock()
	defer n.RUnlock()
	ctx, _ := context.WithTimeout(context.Background(), DEFAULT_CTX_TIMEOUT)
	version, err := n.client.SoftwareVersion(ctx, &cc.EmptyMsg{})
	return version.Version, err
}
116076
func (g *GPG) Version(context.Context) semver.Version {
	return semver.Version{Major: 1}
}
1179554
func ContentReleaseVersion(version int32) ContentOption {
	return func(opts *options) {
		opts.contentReq.Version = version
	}
}
1276891
func (ad *ArchiveData) Version() (*version.Number, error) {
	meta, err := ad.Metadata()
	if errors.IsNotFound(err) {
		return &legacyVersion, nil
	}
	if err != nil {
		return nil, errors.Trace(err)
	}

	return &meta.Origin.Version, nil
}
1272159
func (c *commandeer) isThemeVsHugoVersionMismatch(fs afero.Fs) (dir string, mismatch bool, requiredMinVersion string) {
	if !c.hugo.PathSpec.ThemeSet() {
		return
	}

	for _, absThemeDir := range c.hugo.BaseFs.AbsThemeDirs {

		path := filepath.Join(absThemeDir, "theme.toml")

		exists, err := helpers.Exists(path, fs)

		if err != nil || !exists {
			continue
		}

		b, err := afero.ReadFile(fs, path)
		if err != nil {
			continue
		}

		tomlMeta, err := metadecoders.Default.UnmarshalToMap(b, metadecoders.TOML)
		if err != nil {
			continue
		}

		if minVersion, ok := tomlMeta["min_version"]; ok {
			if hugo.CompareVersion(minVersion) > 0 {
				return absThemeDir, true, fmt.Sprint(minVersion)
			}
		}

	}

	return
}
627910
func (c *asyncClient) Lastsave() (result FutureInt64, err Error) {
	var resp *PendingResponse
	resp, err = c.conn.QueueRequest(&LASTSAVE, [][]byte{})
	if err == nil {
		result = resp.future.(FutureInt64)
	}
	return result, err

}
1077724
func GitVersionTags(gitRepoDir string) ([]*ver.Version, error) {
	tagList, err := gitRemoteTagList(gitRepoDir)
	if err != nil {
		return []*ver.Version{}, fmt.Errorf("Could not get version tag list, error: %s", err)
	}

	tags := filterVersionTags(tagList)

	sort.Sort(ByVersion(tags))

	return tags, nil
}