func (m *Manifest) DownloadURLAndHash(
	context *updateutil.InstanceContext,
	packageName string,
	version string) (result string, hash string, err error) {
	fileName := context.FileName(packageName)

	for _, p := range m.Packages {
		if p.Name == packageName {
			for _, f := range p.Files {
				if f.Name == fileName {
					for _, v := range f.AvailableVersions {
						if version == v.Version || version == updateutil.PipelineTestVersion {
							result = m.URIFormat
							result = strings.Replace(result, updateutil.RegionHolder, context.Region, -1)
							result = strings.Replace(result, updateutil.PackageNameHolder, packageName, -1)
							result = strings.Replace(result, updateutil.PackageVersionHolder, version, -1)
							result = strings.Replace(result, updateutil.FileNameHolder, f.Name, -1)
							if version == updateutil.PipelineTestVersion {
								return result, "", nil
							}
							return result, v.Checksum, nil
						}
					}
				}
			}
		}
	}

	return "", "", fmt.Errorf("incorrect package name or version, %v, %v", packageName, version)
}
// DownloadURLAndHash returns download source url and hash value
DownloadURLAndHash returns download source url and hash value
// DownloadURLAndHash returns download source url and hash value
func (m *Manifest) DownloadURLAndHash(
	context *updateutil.InstanceContext,
	packageName string,
	version string) (result string, hash string, err error) {
	fileName := context.FileName(packageName)
	for _, p := range m.Packages {
		if p.Name == packageName {
			for _, f := range p.Files {
				if f.Name == fileName {
					for _, v := range f.AvailableVersions {
						if version == v.Version || version == updateutil.PipelineTestVersion {
							result = m.URIFormat
							result = strings.Replace(result, updateutil.RegionHolder, context.Region, -1)
							result = strings.Replace(result, updateutil.PackageNameHolder, packageName, -1)
							result = strings.Replace(result, updateutil.PackageVersionHolder, version, -1)
							result = strings.Replace(result, updateutil.FileNameHolder, f.Name, -1)
							if version == updateutil.PipelineTestVersion {
								return result, "", nil
							}
							return result, v.Checksum, nil
						}
					}
				}
			}
		}
	}
	return "", "", fmt.Errorf("incorrect package name or version, %v, %v", packageName, version)
}
func ( m * Manifest ) DownloadURLAndHash ( context * updateutil . InstanceContext , packageName string , version string ) ( result string , hash string , err error ) { fileName := context . FileName ( packageName ) for _ , p := range m . Packages { if p . Name == packageName { for _ , f := range p . Files { if f . Name == fileName { for _ , v := range f . AvailableVersions { if version == v . Version || version == updateutil . PipelineTestVersion { result = m . URIFormat result = strings . Replace ( result , updateutil . RegionHolder , context . Region , - 1 ) result = strings . Replace ( result , updateutil . PackageNameHolder , packageName , - 1 ) result = strings . Replace ( result , updateutil . PackageVersionHolder , version , - 1 ) result = strings . Replace ( result , updateutil . FileNameHolder , f . Name , - 1 ) if version == updateutil . PipelineTestVersion { return result , " " , nil } return result , v . Checksum , nil } } } } } } return " " , " " , fmt . Errorf ( " " , packageName , version ) }
DownloadURLAndHash returns download source url and hash value
DownloadURLAndHash returns download source url and hash value