What cons (or pros) there might be in this implementation? type State func() (State, error)
func (s State) Activate() (funcErr error) { next := s for next != nil && funcErr == nil { next, funcErr = next() } return } type FSM interface { Start() State } - Calling it a FSM (Finite State Machine) might be inaccurate. But that was what came to my mind at the moment. - I got exited by this (and other amazing things than we can do in Go) but I wanted to make sure using this would not bring much harm into a code-base. I've used it just a bit, but couldn't see through future! - Sample usage here <https://gist.github.com/dc0d/f994f74dabf9854d8af30fa1e172046c>; Any feedback is most appreciated! -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.