Fix a few minor govet issues

This commit is contained in:
Chris Sexton 2016-03-19 11:38:18 -04:00
parent 624d96a10c
commit b6d63f6432
3 changed files with 9 additions and 9 deletions

View File

@ -84,7 +84,7 @@ func (p *CounterPlugin) Message(message bot.Message) bool {
}
resp = fmt.Sprintf("%s %s: %d", resp, it.Item, it.Count)
if count > 20 {
fmt.Sprintf("%s, and a few others", resp)
resp = fmt.Sprintf("%s, and a few others", resp)
break
}
}

View File

@ -229,18 +229,18 @@ func NewFactoidPlugin(botInst *bot.Bot) *FactoidPlugin {
for _, channel := range botInst.Config.Channels {
go p.factTimer(channel)
go func() {
go func(ch) {
// Some random time to start up
time.Sleep(time.Duration(15) * time.Second)
if ok, fact := p.findTrigger(p.Bot.Config.StartupFact); ok {
p.sayFact(bot.Message{
Channel: channel,
Channel: ch,
Body: "speed test", // BUG: This is defined in the config too
Command: true,
Action: false,
}, *fact)
}
}()
}(channel)
}
return p
@ -373,7 +373,7 @@ func (p *FactoidPlugin) tellThemWhatThatWas(message bot.Message) bool {
msg = "Nope."
} else {
msg = fmt.Sprintf("That was (#%d) '%s <%s> %s'",
fact.id, fact.fact, fact.verb, fact.tidbit)
fact.id.Int64, fact.fact, fact.verb, fact.tidbit)
}
p.Bot.SendMessage(message.Channel, msg)
return true
@ -435,7 +435,7 @@ func (p *FactoidPlugin) forgetLastFact(message bot.Message) bool {
if err != nil {
log.Println("Error removing fact: ", p.LastFact, err)
}
fmt.Printf("Forgot #%d: %s %s %s\n", p.LastFact.id, p.LastFact.fact,
fmt.Printf("Forgot #%d: %s %s %s\n", p.LastFact.id.Int64, p.LastFact.fact,
p.LastFact.verb, p.LastFact.tidbit)
p.Bot.SendAction(message.Channel, "hits himself over the head with a skillet")
p.LastFact = nil

View File

@ -1,4 +1,4 @@
// Package to connect to slack service
// Package slack connects to slack service
package slack
import (
@ -113,7 +113,7 @@ func (s *Slack) Serve() {
for {
msg, err := s.receiveMessage()
if err != nil {
log.Printf("Slack API error: ", err)
log.Fatalf("Slack API error: %s", err)
}
switch msg.Type {
case "message":
@ -134,7 +134,7 @@ func (s *Slack) Serve() {
// Convert a slackMessage to a bot.Message
func (s *Slack) buildMessage(msg slackMessage) bot.Message {
log.Println("DEBUG: msg: %%#v", msg)
log.Printf("DEBUG: msg: %#v", msg)
text := html.UnescapeString(msg.Text)
isCmd, text := bot.IsCmd(s.config, text)