aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfaiface <faiface@ksp.sk>2017-08-20 12:17:37 +0200
committerfaiface <faiface@ksp.sk>2017-08-20 12:17:37 +0200
commit49051b7cfbd2e8970f28c82861311577ba1c2765 (patch)
treeda85f4e538f11df6be33160a00b990e43ce8972e
parent4ae926b8859d7246ffb9b68e453668aa19f486f5 (diff)
downloadgui-49051b7cfbd2e8970f28c82861311577ba1c2765.zip
event: add Sscan
-rw-r--r--event/dispatch.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/event/dispatch.go b/event/dispatch.go
index 6fe0102..738161a 100644
--- a/event/dispatch.go
+++ b/event/dispatch.go
@@ -20,6 +20,12 @@ func Sprint(a ...interface{}) string {
return buf.String()
}
+func Sscan(event string, a ...interface{}) {
+ for i, part := range strings.Split(event, Sep) {
+ fmt.Sscan(part, a[i])
+ }
+}
+
type Dispatch struct {
mu sync.Mutex
handlers []func(event string) bool