fix message member scope
This commit is contained in:
parent
6c7c3faf28
commit
2b3068fcd0
@ -14,9 +14,9 @@ const (
|
|||||||
type Eventtype int
|
type Eventtype int
|
||||||
|
|
||||||
type EventMessage struct {
|
type EventMessage struct {
|
||||||
on Eventtype
|
On Eventtype
|
||||||
source State
|
Source State
|
||||||
dest State
|
Dest State
|
||||||
}
|
}
|
||||||
|
|
||||||
type EventChannel chan EventMessage
|
type EventChannel chan EventMessage
|
||||||
@ -26,5 +26,5 @@ func (e *EventChannel) Notify(m *EventMessage) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m EventMessage) String() string {
|
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)
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,6 @@ func (r *Transition) Subscribe(s Subscriber) {
|
|||||||
|
|
||||||
func (r *Transition) Notify(on Eventtype, source State, dest State) {
|
func (r *Transition) Notify(on Eventtype, source State, dest State) {
|
||||||
for _, s := range r.subscriptions {
|
for _, s := range r.subscriptions {
|
||||||
s.Notify(&EventMessage{on: on, source: source, dest: dest})
|
s.Notify(&EventMessage{On: On, Source: Source, Dest: Dest})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user