// Valid returns true if the Message is valid. Invalid messages sent as
// commands are discarded by the state machine.
Valid returns true if the Message is valid. Invalid messages sent as
commands are discarded by the state machine.
// Valid returns true if the Message is valid . Invalid messages sent as // commands are discarded by the state machine .
func (m *Message) Valid() bool {
	switch m.Code {
	case Run, Pause, Release, Checkpoint, Complete, Kill:
		return true
	case Sleep:
		return m.Until != nil
	case Error:
		return m.Err != nil
	default:
		return false
	}
}
func ( m * Message ) Valid ( ) bool { switch m . Code { case Run , Pause , Release , Checkpoint , Complete , Kill : return true case Sleep : return m . Until != nil case Error : return m . Err != nil default : return false } }
Valid returns true if the Message is valid.
Valid returns true if the Message is valid .