Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
xgo / usr / lib / xgo / cl / _testgop / repeatuntil / out.go
Size: Mime:
package main

import "fmt"

func RepeatUntil(cond func() bool, body func()) {
	for !cond() {
		body()
	}
}
func main() {
	x := 0
	RepeatUntil(func() bool {
		return x >= 3
	}, func() {
		fmt.Println(x)
		x++
	})
	RepeatUntil(func() bool {
		return false
	}, func() {
	})
}