Fix formats
This commit is contained in:
parent
84a0cb60ed
commit
9bdf790e25
@ -1,13 +1,13 @@
|
|||||||
package irc
|
package irc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"crypto/sha1"
|
||||||
|
"fmt"
|
||||||
|
"math/rand"
|
||||||
|
"reflect"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
"crypto/sha1"
|
|
||||||
"fmt"
|
|
||||||
"reflect"
|
|
||||||
"math/rand"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func (irc *Connection) AddCallback(eventcode string, callback func(*Event)) string {
|
func (irc *Connection) AddCallback(eventcode string, callback func(*Event)) string {
|
||||||
@ -27,7 +27,7 @@ func (irc *Connection) AddCallback(eventcode string, callback func(*Event)) stri
|
|||||||
func (irc *Connection) RemoveCallback(eventcode string, i string) bool {
|
func (irc *Connection) RemoveCallback(eventcode string, i string) bool {
|
||||||
eventcode = strings.ToUpper(eventcode)
|
eventcode = strings.ToUpper(eventcode)
|
||||||
|
|
||||||
if event, ok := irc.events[eventcode]; ok{
|
if event, ok := irc.events[eventcode]; ok {
|
||||||
if _, ok := event[i]; ok {
|
if _, ok := event[i]; ok {
|
||||||
delete(irc.events[eventcode], i)
|
delete(irc.events[eventcode], i)
|
||||||
return true
|
return true
|
||||||
@ -43,7 +43,7 @@ func (irc *Connection) RemoveCallback(eventcode string, i string) bool {
|
|||||||
func (irc *Connection) ClearCallback(eventcode string) bool {
|
func (irc *Connection) ClearCallback(eventcode string) bool {
|
||||||
eventcode = strings.ToUpper(eventcode)
|
eventcode = strings.ToUpper(eventcode)
|
||||||
|
|
||||||
if _, ok := irc.events[eventcode]; ok{
|
if _, ok := irc.events[eventcode]; ok {
|
||||||
irc.events[eventcode] = make(map[string]func(*Event))
|
irc.events[eventcode] = make(map[string]func(*Event))
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user