// sampleGuard will be a guard for checking if a transition
// can go through
sampleGuard will be a guard for checking if a transition
can go through
// sampleGuard will be a guard for checking if a transition // can go through
func sampleGuard(start fsm.State, goal fsm.State) error {
	if start.I().(Transaction).Amount <= 0 {
		return errors.New("Can't transition, amount is <= 0")
	}
	if start.I().(Transaction).Amount != goal.I().(Transaction).Amount {
		return errors.New("Can't transition, amount is different")
	}
	return nil
}
func sampleGuard ( start fsm . State , goal fsm . State ) error { if start . I ( ) . ( Transaction ) . Amount <= 0 { return errors . New ( " " ) } if start . I ( ) . ( Transaction ) . Amount != goal . I ( ) . ( Transaction ) . Amount { return errors . New ( " " ) } return nil }
sampleGuard will be a guard for checking if a transition
can go through
sampleGuard will be a guard for checking if a transition can go through
// I() returns the interface (of the transaction)