fix message member scope
Some checks failed
Machine Tests / test (push) Waiting to run
Lint / golangci-lint (push) Has been cancelled

This commit is contained in:
Matthew Rich 2024-05-06 22:41:29 -07:00
parent 6c7c3faf28
commit 2b3068fcd0
2 changed files with 5 additions and 5 deletions

View File

@ -14,9 +14,9 @@ const (
type Eventtype int
type EventMessage struct {
on Eventtype
source State
dest State
On Eventtype
Source State
Dest State
}
type EventChannel chan EventMessage
@ -26,5 +26,5 @@ func (e *EventChannel) Notify(m *EventMessage) {
}
func (m EventMessage) String() string {
return fmt.Sprintf("{on: %d, source: %s, dest: %s}", m.on, m.source, m.dest)
return fmt.Sprintf("{On: %d, Source: %s, Dest: %s}", m.On, m.Source, m.Dest)
}

View File

@ -42,6 +42,6 @@ func (r *Transition) Subscribe(s Subscriber) {
func (r *Transition) Notify(on Eventtype, source State, dest State) {
for _, s := range r.subscriptions {
s.Notify(&EventMessage{on: on, source: source, dest: dest})
s.Notify(&EventMessage{On: On, Source: Source, Dest: Dest})
}
}