// addBuildVersion adds the build version to the HTTP response.
769510
func (s *Service) addBuildVersion(w http.ResponseWriter) {
	// Add version header to every response, if available.
	version := "unknown"
	if v, ok := s.BuildInfo["version"].(string); ok {
		version = v
	}
	w.Header().Add(VersionHTTPHeader, version)
}
715959
func (client DefaultClient) CreateVersion(projectID, versionName string) (Version, error) {
	i, err := strconv.Atoi(projectID)
	if err != nil {
		return Version{}, err
	}

	data, err := json.Marshal(&Version{Name: versionName, Description: "Version " + versionName, ProjectID: i, Archived: false, Released: false})
	if err != nil {
		return Version{}, err
	}
	req, err := http.NewRequest("POST", fmt.Sprintf("%s/rest/api/2/version", client.baseURL), bytes.NewBuffer(data))
	if err != nil {
		return Version{}, err
	}
	req.Header.Set("Content-type", "application/json")
	req.SetBasicAuth(client.username, client.password)

	responseCode, data, err := client.consumeResponse(req)
	if err != nil {
		return Version{}, err
	}
	if responseCode != http.StatusCreated {
		logger.Printf("JIRA response: %s\n", string(data))
		return Version{}, fmt.Errorf("error creating project version.  Status code: %d.\n", responseCode)
	}

	var v Version
	if err := json.Unmarshal(data, &v); err != nil {
		return Version{}, err
	}
	return v, nil
}
833615
func BuildVersionString() string {
	program := "Hugo Static Site Generator"

	version := "v" + CurrentVersion.String()
	if commitHash != "" {
		version += "-" + strings.ToUpper(commitHash)
	}
	if isExtended {
		version += "/extended"
	}

	osArch := runtime.GOOS + "/" + runtime.GOARCH

	date := buildDate
	if date == "" {
		date = "unknown"
	}

	return fmt.Sprintf("%s %s %s BuildDate: %s", program, version, osArch, date)

}
917950
func (s *WorkflowTypeFilter) SetVersion(v string) *WorkflowTypeFilter {
	s.Version = &v
	return s
}
948959
func (r *BulkUpdateRequest) Version(version int64) *BulkUpdateRequest {
	r.version = version
	r.source = nil
	return r
}
575646
func (s PluginMetaSet) WithVersion(version Version) PluginMetaSet {
	ns := make(PluginMetaSet)
	for p := range s {
		gotVersion, err := p.Version.Parse()
		if err != nil {
			continue
		}
		if gotVersion.Equal(version) {
			ns.Add(p)
		}
	}
	return ns
}
1276612
func (s *OptionStatus) SetUpdateVersion(v int64) *OptionStatus {
	s.UpdateVersion = &v
	return s
}
1140258
func Convert_build_Build_To_v1_Build(in *build.Build, out *v1.Build, s conversion.Scope) error {
	return autoConvert_build_Build_To_v1_Build(in, out, s)
}
729803
func (v *VersionInfo) Build() {
	vi := VSVersionInfo{}

	// 0 for binary, 1 for text
	vi.WType = 0x00

	vi.SzKey = padString("VS_VERSION_INFO", 0)

	// Align to 32-bit boundary
	// 6 is for the size of WLength, WValueLength, and WType (each is 1 word or 2 bytes: FF FF)
	soFar := 2
	for (len(vi.SzKey)+6+soFar)%4 != 0 {
		soFar += 2
	}
	vi.Padding1 = padBytes(soFar)
	soFar += len(vi.SzKey)

	vi.Value = buildFixedFileInfo(v)

	// Length of VSFixedFileInfo (always the same)
	vi.WValueLength = 0x34

	// Never needs padding, not included in WLength
	vi.Padding2 = []byte{}

	// Build strings
	vi.Children = buildStringFileInfo(v)

	// Build translation
	vi.Children2 = buildVarFileInfo(v.VarFileInfo)

	// Calculate the total size
	vi.WLength += 6 + uint16(soFar) + vi.WValueLength + vi.Children.WLength + vi.Children2.WLength

	v.Structure = vi
}
399876
func getKernelVersion() (string, error) {
	// Get CurrentBuildNumber.
	buildNumber, err := getCurrentVersionVal("CurrentBuildNumber")
	if err != nil {
		return "", err
	}

	// Get CurrentMajorVersionNumber.
	majorVersionNumberString, err := getCurrentVersionVal("CurrentMajorVersionNumber")
	if err != nil {
		return "", err
	}
	majorVersionNumber, err := windows.UTF16FromString(majorVersionNumberString)
	if err != nil {
		return "", err
	}

	// Get CurrentMinorVersionNumber.
	minorVersionNumberString, err := getCurrentVersionVal("CurrentMinorVersionNumber")
	if err != nil {
		return "", err
	}
	minorVersionNumber, err := windows.UTF16FromString(minorVersionNumberString)
	if err != nil {
		return "", err
	}

	// Get UBR.
	revision, err := getVersionRevision()
	if err != nil {
		return "", err
	}

	return fmt.Sprintf("%d.%d.%s.%d", majorVersionNumber[0], minorVersionNumber[0], buildNumber, revision), nil
}
201198
func (s *DatasetContentSummary) SetVersion(v string) *DatasetContentSummary {
	s.Version = &v
	return s
}
1196080
func setBuildAnnotationAndLabel(bcCopy *buildv1.BuildConfig, build *buildv1.Build) {
	if build.Annotations == nil {
		build.Annotations = make(map[string]string)
	}
	// bcCopy.Status.LastVersion has been increased
	build.Annotations[buildutil.BuildNumberAnnotation] = strconv.FormatInt(bcCopy.Status.LastVersion, 10)
	build.Annotations[buildutil.BuildConfigAnnotation] = bcCopy.Name
	if build.Labels == nil {
		build.Labels = make(map[string]string)
	}
	build.Labels[buildutil.BuildConfigLabelDeprecated] = buildapihelpers.LabelValue(bcCopy.Name)
	build.Labels[buildutil.BuildConfigLabel] = buildapihelpers.LabelValue(bcCopy.Name)
	build.Labels[buildutil.BuildRunPolicyLabel] = string(bcCopy.Spec.RunPolicy)
}
664617
func (c *CmdStatus) osVersionAndBuild() (string, string, error) {
	productVersion, err := c.execToString("uname", []string{"-mrs"})
	if err != nil {
		return "", "", err
	}

	buildVersion, err := c.execToString("lsb_release", []string{"-sd"})
	if err != nil {
		return productVersion, "", err
	}

	return productVersion, buildVersion, nil
}
1140909
func (s *VersionService) Create(version *Version) (*Version, *Response, error) {
	apiEndpoint := "/rest/api/2/version"
	req, err := s.client.NewRequest("POST", apiEndpoint, version)
	if err != nil {
		return nil, nil, err
	}

	resp, err := s.client.Do(req, nil)
	if err != nil {
		return nil, resp, err
	}

	responseVersion := new(Version)
	defer resp.Body.Close()
	data, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		e := fmt.Errorf("Could not read the returned data")
		return nil, resp, NewJiraError(resp, e)
	}
	err = json.Unmarshal(data, responseVersion)
	if err != nil {
		e := fmt.Errorf("Could not unmarshall the data into struct")
		return nil, resp, NewJiraError(resp, e)
	}
	return responseVersion, resp, nil
}
1158163
func NewBuildVersion(s string) (string, error) {
	if len(s) == 0 {
		return "", errors.New("Buildversion is empty")
	}
	if !containsOnly(s, alphanum) {
		return "", fmt.Errorf("Invalid character(s) found in build meta data %q", s)
	}
	return s, nil
}
4512
func (b *Builder) AddStructType(typename string, byteSz uint16) dwarf.Offset {
	r := b.TagOpen(dwarf.TagStructType, typename)
	b.Attr(dwarf.AttrByteSize, byteSz)
	return r
}
58166
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 commit hash of current build to version.
	version = fmt.Sprintf("%s commit=%s", version, Commit)

	return version
}