Beispiel #1
0
func invariantBananaLimit(ctx *runway.Context) error {
	env := ctx.Env.(*env)

	if env.bananas <= 8 {
		return nil
	}

	return runway.AssertionFailure("assertion failed: bananas <= 8")
}
Beispiel #2
0
func bananaRangeCheck(ctx *runway.Context) error {

	env := ctx.Env.(*env)

	if env.bananas >= 0 && env.bananas <= 100 {
		return nil
	}
	return runway.AssertionFailure("bananas out of range: 0..100")
}