2
0
mirror of synced 2025-02-23 14:58:12 +00:00

event/lifecycle: add an Event.String method.

Change-Id: I5d648327cf39cd3b2cf97fa08a094744528221fe
Reviewed-on: https://go-review.googlesource.com/18400
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Nigel Tao 2016-01-08 15:47:51 +11:00
parent a103499a63
commit 2e06e2c92c

View File

@ -54,6 +54,10 @@ type Event struct {
DrawContext interface{} 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: // 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 CrossOn if it does, and the lifecycle change is positive.
// - It returns CrossOff if it does, and the lifecycle change is negative. // - It returns CrossOff if it does, and the lifecycle change is negative.