本文整理汇总了Golang中utilz/stringset.StringSet.Iter方法的典型用法代码示例。如果您正苦于以下问题:Golang StringSet.Iter方法的具体用法?Golang StringSet.Iter怎么用?Golang StringSet.Iter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utilz/stringset.StringSet
的用法示例。
在下文中一共展示了StringSet.Iter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: External
func (d Dag) External(update bool) {
var argv []string
var set *stringset.StringSet
var i int = 0
set = d.Alien()
argv = make([]string, 0)
argv = append(argv, "go")
argv = append(argv, "get")
if global.GetBool("-verbose") {
argv = append(argv, "-v")
}
if update {
argv = append(argv, "-u")
}
argv = append(argv, "-a")
i = len(argv)
argv = append(argv, "dummy")
for u := range set.Iter() {
argv[i] = u
if global.GetBool("-dryrun") {
fmt.Printf("%s || exit 1\n", strings.Join(argv, " "))
} else {
say.Printf("go get: %s\n", u)
handy.StdExecve(argv, true)
}
}
}
示例2: External
func (d Dag) External() {
var err os.Error
var argv []string
var tmp string
var set *stringset.StringSet
var i int = 0
set = stringset.New()
for _, v := range d {
for dep := range v.dependencies.Iter() {
if !d.localDependency(dep) {
set.Add(dep)
}
}
}
for u := range set.Iter() {
if !seemsExternal(u) {
set.Remove(u)
}
}
argv = make([]string, 0)
tmp, err = exec.LookPath("goinstall")
if err != nil {
log.Fatalf("[ERROR] %s\n", err)
}
argv = append(argv, tmp)
if global.GetBool("-verbose") {
argv = append(argv, "-v=true")
}
argv = append(argv, "-u=true")
argv = append(argv, "-clean=true")
i = len(argv)
argv = append(argv, "dummy")
for u := range set.Iter() {
argv[i] = u
if global.GetBool("-dryrun") {
fmt.Printf("%s || exit 1\n", strings.Join(argv, " "))
} else {
say.Printf("goinstall: %s\n", u)
handy.StdExecve(argv, true)
}
}
}
示例3: External
func (d Dag) External() {
var err os.Error
var argv []string
var tmp string
var set *stringset.StringSet
var i int = 0
set = d.Alien()
argv = make([]string, 0)
tmp, err = exec.LookPath("goinstall")
if err != nil {
log.Fatalf("[ERROR] %s\n", err)
}
argv = append(argv, tmp)
if global.GetBool("-verbose") {
argv = append(argv, "-v=true")
}
argv = append(argv, "-u=true")
argv = append(argv, "-clean=true")
i = len(argv)
argv = append(argv, "dummy")
for u := range set.Iter() {
argv[i] = u
if global.GetBool("-dryrun") {
fmt.Printf("%s || exit 1\n", strings.Join(argv, " "))
} else {
say.Printf("goinstall: %s\n", u)
handy.StdExecve(argv, true)
}
}
}