From 2b3068fcd02ce67da3178a5004a2ae6ca02a4349 Mon Sep 17 00:00:00 2001 From: Matthew Rich Date: Mon, 6 May 2024 22:41:29 -0700 Subject: [PATCH] fix message member scope --- message.go | 8 ++++---- transition.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/message.go b/message.go index da2eada..1e175be 100644 --- a/message.go +++ b/message.go @@ -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) } diff --git a/transition.go b/transition.go index 8c8be1d..6f95f8e 100644 --- a/transition.go +++ b/transition.go @@ -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}) } }