func (p *event) Off(f interface{}) error {
	fn := reflect.ValueOf(f)
	p.lmu.Lock()
	defer p.lmu.Unlock()
	l := len(p.listeners)
	m := l  
	for i := 0; i < l; i++ {
		if fn == p.listeners[i] {
			p.listeners = append(p.listeners[:i], p.listeners[i+1:]...)
			l--
			i--
		}
	}
	if l == m {
		return fmt.Errorf("Listener does't exists")
	}
	return nil
}
Stop listening an event.
package goevent
import (
	"fmt"
	"reflect"
	"sync"
)
type Event interface {
	Trigger(args ...interface{}) error
	On(f interface{}) error
	Off(f interface{}) error
}
type event struct {
	listeners []reflect.Value
	lmu       sync.RWMutex
	argTypes []reflect.Type
	tmu      sync.RWMutex
}
func New() Event {
	return &event{}
}
var _ Event = New()
func (p *event) Trigger(args ...interface{}) error {
	arguments := make([]reflect.Value, 0, len(args))
	argTypes := make([]reflect.Type, 0, len(args))
	for _, v := range args {
		arguments = append(arguments, reflect.ValueOf(v))
		argTypes = append(argTypes, reflect.TypeOf(v))
	}
	err := p.validateArgs(argTypes)
	if err != nil {
		return err
	}
	p.lmu.RLock()
	defer p.lmu.RUnlock()
	wg := sync.WaitGroup{}
	wg.Add(len(p.listeners))
	for _, fn := range p.listeners {
		go func(f reflect.Value) {
			defer wg.Done()
			f.Call(arguments)
		}(fn)
	}
	wg.Wait()
	return nil
}
func (p *event) On(f interface{}) error {
	fn, err := p.checkFuncSignature(f)
	if err != nil {
		return err
	}
	p.lmu.Lock()
	defer p.lmu.Unlock()
	p.listeners = append(p.listeners, *fn)
	return nil
}