本文整理汇总了Golang中github.com/bitrise-io/stepman/models.StepModel.HostOsTags方法的典型用法代码示例。如果您正苦于以下问题:Golang StepModel.HostOsTags方法的具体用法?Golang StepModel.HostOsTags怎么用?Golang StepModel.HostOsTags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/bitrise-io/stepman/models.StepModel
的用法示例。
在下文中一共展示了StepModel.HostOsTags方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: MergeStepWith
// MergeStepWith ...
func MergeStepWith(step, otherStep stepmanModels.StepModel) (stepmanModels.StepModel, error) {
if otherStep.Title != nil {
step.Title = pointers.NewStringPtr(*otherStep.Title)
}
if otherStep.Description != nil {
step.Description = pointers.NewStringPtr(*otherStep.Description)
}
if otherStep.Summary != nil {
step.Summary = pointers.NewStringPtr(*otherStep.Summary)
}
if otherStep.Website != nil {
step.Website = pointers.NewStringPtr(*otherStep.Website)
}
if otherStep.SourceCodeURL != nil {
step.SourceCodeURL = pointers.NewStringPtr(*otherStep.SourceCodeURL)
}
if otherStep.SupportURL != nil {
step.SupportURL = pointers.NewStringPtr(*otherStep.SupportURL)
}
if otherStep.PublishedAt != nil {
step.PublishedAt = pointers.NewTimePtr(*otherStep.PublishedAt)
}
if otherStep.Source.Git != "" {
step.Source.Git = otherStep.Source.Git
}
if otherStep.Source.Commit != "" {
step.Source.Commit = otherStep.Source.Commit
}
if len(otherStep.Dependencies) > 0 {
step.Dependencies = otherStep.Dependencies
}
if len(otherStep.Deps.Brew) > 0 || len(otherStep.Deps.AptGet) > 0 || len(otherStep.Deps.CheckOnly) > 0 {
step.Deps = otherStep.Deps
}
if len(otherStep.HostOsTags) > 0 {
step.HostOsTags = otherStep.HostOsTags
}
if len(otherStep.ProjectTypeTags) > 0 {
step.ProjectTypeTags = otherStep.ProjectTypeTags
}
if len(otherStep.TypeTags) > 0 {
step.TypeTags = otherStep.TypeTags
}
if otherStep.IsRequiresAdminUser != nil {
step.IsRequiresAdminUser = pointers.NewBoolPtr(*otherStep.IsRequiresAdminUser)
}
if otherStep.IsAlwaysRun != nil {
step.IsAlwaysRun = pointers.NewBoolPtr(*otherStep.IsAlwaysRun)
}
if otherStep.IsSkippable != nil {
step.IsSkippable = pointers.NewBoolPtr(*otherStep.IsSkippable)
}
if otherStep.RunIf != nil {
step.RunIf = pointers.NewStringPtr(*otherStep.RunIf)
}
for _, input := range step.Inputs {
key, _, err := input.GetKeyValuePair()
if err != nil {
return stepmanModels.StepModel{}, err
}
otherInput, found := getInputByKey(otherStep, key)
if found {
err := MergeEnvironmentWith(&input, otherInput)
if err != nil {
return stepmanModels.StepModel{}, err
}
}
}
for _, output := range step.Outputs {
key, _, err := output.GetKeyValuePair()
if err != nil {
return stepmanModels.StepModel{}, err
}
otherOutput, found := getOutputByKey(otherStep, key)
if found {
err := MergeEnvironmentWith(&output, otherOutput)
if err != nil {
return stepmanModels.StepModel{}, err
}
}
}
return step, nil
}
示例2: MergeStepWith
// MergeStepWith ...
func MergeStepWith(step, otherStep stepmanModels.StepModel) (stepmanModels.StepModel, error) {
if err := step.FillMissingDeafults(); err != nil {
return stepmanModels.StepModel{}, err
}
if otherStep.Title != nil {
*step.Title = *otherStep.Title
}
if otherStep.Description != nil {
*step.Description = *otherStep.Description
}
if otherStep.Summary != nil {
*step.Summary = *otherStep.Summary
}
if otherStep.Website != nil {
*step.Website = *otherStep.Website
}
if otherStep.SourceCodeURL != nil {
*step.SourceCodeURL = *otherStep.SourceCodeURL
}
if otherStep.SupportURL != nil {
*step.SupportURL = *otherStep.SupportURL
}
if otherStep.Source.Git != nil {
*step.Source.Git = *otherStep.Source.Git
}
if len(otherStep.HostOsTags) > 0 {
step.HostOsTags = otherStep.HostOsTags
}
if len(otherStep.ProjectTypeTags) > 0 {
step.ProjectTypeTags = otherStep.ProjectTypeTags
}
if len(otherStep.TypeTags) > 0 {
step.TypeTags = otherStep.TypeTags
}
if otherStep.IsRequiresAdminUser != nil {
*step.IsRequiresAdminUser = *otherStep.IsRequiresAdminUser
}
if otherStep.IsAlwaysRun != nil {
*step.IsAlwaysRun = *otherStep.IsAlwaysRun
}
if otherStep.IsSkippable != nil {
*step.IsSkippable = *otherStep.IsSkippable
}
if otherStep.RunIf != nil {
*step.RunIf = *otherStep.RunIf
}
for _, input := range step.Inputs {
key, _, err := input.GetKeyValuePair()
if err != nil {
return stepmanModels.StepModel{}, err
}
otherInput, found := getInputByKey(otherStep, key)
if found {
err := MergeEnvironmentWith(&input, otherInput)
if err != nil {
return stepmanModels.StepModel{}, err
}
}
}
for _, output := range step.Outputs {
key, _, err := output.GetKeyValuePair()
if err != nil {
return stepmanModels.StepModel{}, err
}
otherOutput, found := getOutputByKey(otherStep, key)
if found {
err := MergeEnvironmentWith(&output, otherOutput)
if err != nil {
return stepmanModels.StepModel{}, err
}
}
}
return step, nil
}