本文整理汇总了Golang中github.com/juju/juju/version.Number.IsDev方法的典型用法代码示例。如果您正苦于以下问题:Golang Number.IsDev方法的具体用法?Golang Number.IsDev怎么用?Golang Number.IsDev使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/juju/juju/version.Number
的用法示例。
在下文中一共展示了Number.IsDev方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: PreferredStream
// PreferredStream returns the tools stream used to search for tools, based
// on the required version, whether devel mode is required, and any user specified stream.
func PreferredStream(vers *version.Number, forceDevel bool, stream string) string {
// If the use has already nominated a specific stream, we'll use that.
if stream != "" && stream != ReleasedStream {
return stream
}
// If we're not upgrading from a known version, we use the
// currently running version.
if vers == nil {
vers = &version.Current.Number
}
// Devel versions are alpha or beta etc as defined by the version tag.
// The user can also force the use of devel streams via config.
if forceDevel || vers.IsDev() {
return DevelStream
}
return ReleasedStream
}