本文整理汇总了Golang中github.com/juju/version.Number.Tag方法的典型用法代码示例。如果您正苦于以下问题:Golang Number.Tag方法的具体用法?Golang Number.Tag怎么用?Golang Number.Tag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/juju/version.Number
的用法示例。
在下文中一共展示了Number.Tag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: newOpsIterator
func newOpsIterator(from, to version.Number, ops []Operation) *opsIterator {
// If from is not known, it is 1.16.
if from == version.Zero {
from = version.MustParse("1.16.0")
}
// Clear the version tag of the target release to ensure that all
// upgrade steps for the release are run for alpha and beta
// releases.
// ...but only do this if the agent version has actually changed,
// lest we trigger upgrade mode unnecessarily for non-final
// versions.
if from.Compare(to) != 0 {
to.Tag = ""
}
return &opsIterator{
from: from,
to: to,
allOps: ops,
current: -1,
}
}