hasValidValues() + tests started
This commit is contained in:
14
irc.go
14
irc.go
@@ -388,3 +388,17 @@ func IRC(nick, user string) *Connection {
|
||||
irc.setupCallbacks()
|
||||
return irc
|
||||
}
|
||||
|
||||
// Returns true if all values in struct make
|
||||
// somewhat sense.
|
||||
func (irc *Connection) hasValidValues() bool {
|
||||
if 0 == len(irc.nick) {
|
||||
return false
|
||||
}
|
||||
|
||||
if 0 == len(irc.Version) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user