diff options
| author | faiface <faiface@ksp.sk> | 2017-08-20 12:17:37 +0200 |
|---|---|---|
| committer | faiface <faiface@ksp.sk> | 2017-08-20 12:17:37 +0200 |
| commit | 49051b7cfbd2e8970f28c82861311577ba1c2765 (patch) | |
| tree | da85f4e538f11df6be33160a00b990e43ce8972e | |
| parent | 4ae926b8859d7246ffb9b68e453668aa19f486f5 (diff) | |
| download | gui-49051b7cfbd2e8970f28c82861311577ba1c2765.zip | |
event: add Sscan
| -rw-r--r-- | event/dispatch.go | 6 |
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 |