mirror of https://github.com/velour/catbase.git
go fmt
This commit is contained in:
parent
f164530359
commit
c639d460ac
|
@ -265,7 +265,6 @@ func TestBabblerBadMiddleOutSeed(t *testing.T) {
|
|||
assert.Equal(t, mb.Messages[0], "seabass never said 'anything true'")
|
||||
}
|
||||
|
||||
|
||||
func TestBabblerBatch(t *testing.T) {
|
||||
mb := bot.NewMockBot()
|
||||
c := New(mb)
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
package reaction
|
||||
|
||||
import (
|
||||
"time"
|
||||
"math/rand"
|
||||
"time"
|
||||
|
||||
"github.com/velour/catbase/bot"
|
||||
"github.com/velour/catbase/bot/msg"
|
||||
|
@ -45,7 +45,7 @@ func (p *ReactionPlugin) Message(message msg.Message) bool {
|
|||
numPositiveReactions := len(p.Config.Reaction.PositiveReactions)
|
||||
numNegativeReactions := len(p.Config.Reaction.NegativeReactions)
|
||||
|
||||
maxIndex := numPositiveReactions + numNegativeReactions * negativeWeight
|
||||
maxIndex := numPositiveReactions + numNegativeReactions*negativeWeight
|
||||
|
||||
index := rand.Intn(maxIndex)
|
||||
|
||||
|
|
|
@ -38,10 +38,10 @@ func (c *cacheItem) getCurrentPage(maxLines int) string {
|
|||
|
||||
page := strings.Join(c.data[start:end], "\n")
|
||||
|
||||
if end - start == maxLines {
|
||||
if end-start == maxLines {
|
||||
c.currentLine = end
|
||||
} else {
|
||||
c.currentLine = maxLines-(end-start)
|
||||
c.currentLine = maxLines - (end - start)
|
||||
page += "\n"
|
||||
page += strings.Join(c.data[0:c.currentLine], "\n")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue