diff --git a/.travis.yml b/.travis.yml index 33c91a8..c28273e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ before_install: script: - $HOME/gopath/bin/goveralls -service=travis-ci - $HOME/gopath/bin/golint -min_confidence 0.9 -set_exit_status -- go test -v -race -timeout 3m -count 3 +- GORACE="exitcode=1 halt_on_error=1" go test -v -race -timeout 3m -count 3 - go tool vet -v -all . branches: only: diff --git a/ctcp.go b/ctcp.go index 1d88b3b..1377d81 100644 --- a/ctcp.go +++ b/ctcp.go @@ -41,7 +41,7 @@ func decodeCTCP(e *Event) *CTCPEvent { return nil } - if (e.Command != "PRIVMSG" && e.Command != "NOTICE") || !IsValidNick(e.Params[0]) { + if (e.Command != PRIVMSG && e.Command != NOTICE) || !IsValidNick(e.Params[0]) { return nil } @@ -67,7 +67,7 @@ func decodeCTCP(e *Event) *CTCPEvent { Origin: e, Source: e.Source, Command: text, - Reply: e.Command == "NOTICE", + Reply: e.Command == NOTICE, } } @@ -84,7 +84,7 @@ func decodeCTCP(e *Event) *CTCPEvent { Source: e.Source, Command: text[0:s], Text: text[s+1:], - Reply: e.Command == "NOTICE", + Reply: e.Command == NOTICE, } } diff --git a/event.go b/event.go index 49a772b..c55f37e 100644 --- a/event.go +++ b/event.go @@ -51,7 +51,7 @@ func ParseEvent(raw string) (e *Event) { return nil } - i, j := 0, 0 + var i, j int e = &Event{} if raw[0] == prefixTag {