some golint/vet and changed output format.

feedback in #exmormon said put url at end.
This commit is contained in:
sm
2016-05-08 13:17:03 -07:00
parent 4055810f22
commit 2547281d09
2 changed files with 27 additions and 25 deletions
+7 -5
View File
@@ -11,8 +11,8 @@ import (
irc "github.com/fluffle/goirc/client"
)
var host *string = flag.String("host", "localhost:6668", "irc server hostname")
var channel *string = flag.String("channel", "#exmormon", "irc channel")
var host = flag.String("host", "localhost:6668", "irc server hostname")
var channel = flag.String("channel", "#exmormon", "irc channel")
func main() {
rand.Seed(time.Now().UnixNano())
@@ -21,17 +21,19 @@ func main() {
done := make(chan bool)
Register(*host, *channel, done)
register(*host, *channel, done)
<-done
}
const name = "BYbot"
// BY is the Go embodiment of Brigham Young.
type BY struct {
quotes []string
poke chan bool
}
// Random returns a random BY quote. That asshat.
func (by *BY) Random() string {
if len(by.quotes) == 0 {
return ""
@@ -52,7 +54,7 @@ func (by *BY) spew(conn *irc.Conn, channel string) {
}
}
func Register(host, channel string, done chan<- bool) {
func register(host, channel string, done chan<- bool) {
var p *regexp.Regexp
by := BY{
quotes,
@@ -95,7 +97,7 @@ func Register(host, channel string, done chan<- bool) {
}
}
var quotes []string = []string{
var quotes = []string{
"♬♬ God changed his mind about black people (black people!!) ♬♬",
"Wife! Bring me a wife!!",