hasValidValues() + tests started

This commit is contained in:
tpltnt
2014-02-16 00:32:02 +01:00
parent a4d40a90d5
commit 28bf282924
2 changed files with 50 additions and 1 deletions

14
irc.go
View File

@@ -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
}