From 2e06e2c92ceb6c858fdae89614583d00eac4b9d9 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Fri, 8 Jan 2016 15:47:51 +1100 Subject: [PATCH] event/lifecycle: add an Event.String method. Change-Id: I5d648327cf39cd3b2cf97fa08a094744528221fe Reviewed-on: https://go-review.googlesource.com/18400 Reviewed-by: David Crawshaw --- event/lifecycle/lifecycle.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/event/lifecycle/lifecycle.go b/event/lifecycle/lifecycle.go index b25ca68..bed3b49 100644 --- a/event/lifecycle/lifecycle.go +++ b/event/lifecycle/lifecycle.go @@ -54,6 +54,10 @@ type Event struct { DrawContext interface{} } +func (e Event) String() string { + return fmt.Sprintf("lifecycle.Event{From:%v, To:%v, DrawContext:%v}", e.From, e.To, e.DrawContext) +} + // Crosses returns whether the transition from From to To crosses the stage s: // - It returns CrossOn if it does, and the lifecycle change is positive. // - It returns CrossOff if it does, and the lifecycle change is negative.