From 824797815184cd60a2bd23ba12cb8e187a20551e Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Thu, 25 Nov 2021 23:48:16 +0100 Subject: [PATCH] [lint] Properly format inputs Signed-off-by: Knut Ahlers --- action_counter.go | 3 ++- action_script.go | 5 +++-- action_setvar.go | 3 ++- actions.go | 3 ++- actorDocs.go | 3 ++- automessage.go | 5 +++-- botEditor.go | 3 ++- botUserState.go | 3 ++- config.go | 3 ++- configEditor.go | 5 +++-- configEditor_automessage.go | 3 ++- configEditor_general.go | 3 ++- configEditor_global.go | 3 ++- configEditor_rules.go | 3 ++- examples/plugin/main.go | 3 ++- functions.go | 5 +++-- functions_counter.go | 3 ++- functions_irc.go | 3 ++- internal/actors/delay/actor.go | 3 ++- internal/actors/delete/actor.go | 3 ++- internal/actors/modchannel/actor.go | 5 +++-- internal/actors/nuke/actor.go | 7 ++++--- internal/actors/punish/actor.go | 3 ++- internal/actors/quotedb/actor.go | 3 ++- internal/actors/quotedb/http.go | 3 ++- internal/actors/raw/actor.go | 3 ++- internal/actors/respond/actor.go | 3 ++- internal/actors/timeout/actor.go | 3 ++- internal/actors/whisper/actor.go | 3 ++- internal/template/random/random.go | 3 ++- irc.go | 5 +++-- msgformatter.go | 3 ++- plugins.go | 3 ++- plugins/interface.go | 3 ++- plugins/rule.go | 5 +++-- plugins/rule_test.go | 3 ++- plugins_core.go | 5 +++-- store.go | 3 ++- swagger.go | 3 ++- twitch/eventsub.go | 3 ++- twitch/twitch.go | 3 ++- twitchWatcher.go | 5 +++-- writeAuth.go | 3 ++- 43 files changed, 97 insertions(+), 54 deletions(-) diff --git a/action_counter.go b/action_counter.go index 97c33da..567cb2c 100644 --- a/action_counter.go +++ b/action_counter.go @@ -5,10 +5,11 @@ import ( "net/http" "strconv" - "github.com/Luzifer/twitch-bot/plugins" "github.com/go-irc/irc" "github.com/gorilla/mux" "github.com/pkg/errors" + + "github.com/Luzifer/twitch-bot/plugins" ) func init() { diff --git a/action_script.go b/action_script.go index 02ee5cb..c1ab93f 100644 --- a/action_script.go +++ b/action_script.go @@ -7,10 +7,11 @@ import ( "os" "os/exec" - "github.com/Luzifer/twitch-bot/plugins" - "github.com/Luzifer/twitch-bot/twitch" "github.com/go-irc/irc" "github.com/pkg/errors" + + "github.com/Luzifer/twitch-bot/plugins" + "github.com/Luzifer/twitch-bot/twitch" ) func init() { diff --git a/action_setvar.go b/action_setvar.go index 2da85bc..cc1d7e7 100644 --- a/action_setvar.go +++ b/action_setvar.go @@ -4,10 +4,11 @@ import ( "fmt" "net/http" - "github.com/Luzifer/twitch-bot/plugins" "github.com/go-irc/irc" "github.com/gorilla/mux" "github.com/pkg/errors" + + "github.com/Luzifer/twitch-bot/plugins" ) func init() { diff --git a/actions.go b/actions.go index dc98b3b..156c1d6 100644 --- a/actions.go +++ b/actions.go @@ -3,10 +3,11 @@ package main import ( "sync" - "github.com/Luzifer/twitch-bot/plugins" "github.com/go-irc/irc" "github.com/pkg/errors" log "github.com/sirupsen/logrus" + + "github.com/Luzifer/twitch-bot/plugins" ) var ( diff --git a/actorDocs.go b/actorDocs.go index d5f0550..b7baeb5 100644 --- a/actorDocs.go +++ b/actorDocs.go @@ -5,8 +5,9 @@ import ( _ "embed" "text/template" - "github.com/Luzifer/twitch-bot/plugins" "github.com/pkg/errors" + + "github.com/Luzifer/twitch-bot/plugins" ) //go:embed actorDocs.tpl diff --git a/automessage.go b/automessage.go index c94ad69..c98cb5d 100644 --- a/automessage.go +++ b/automessage.go @@ -6,13 +6,14 @@ import ( "sync" "time" - "github.com/Luzifer/go_helpers/v2/str" - "github.com/Luzifer/twitch-bot/plugins" "github.com/go-irc/irc" "github.com/mitchellh/hashstructure/v2" "github.com/pkg/errors" "github.com/robfig/cron/v3" log "github.com/sirupsen/logrus" + + "github.com/Luzifer/go_helpers/v2/str" + "github.com/Luzifer/twitch-bot/plugins" ) var cronParser = cron.NewParser(cron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor) diff --git a/botEditor.go b/botEditor.go index 306f1d7..d98642a 100644 --- a/botEditor.go +++ b/botEditor.go @@ -3,9 +3,10 @@ package main import ( "net/http" + "github.com/pkg/errors" + "github.com/Luzifer/go_helpers/v2/str" "github.com/Luzifer/twitch-bot/twitch" - "github.com/pkg/errors" ) func getAuthorizationFromRequest(r *http.Request) (string, *twitch.Client, error) { diff --git a/botUserState.go b/botUserState.go index 65f386d..c443d2c 100644 --- a/botUserState.go +++ b/botUserState.go @@ -4,8 +4,9 @@ import ( "strings" "sync" - "github.com/Luzifer/twitch-bot/twitch" "github.com/go-irc/irc" + + "github.com/Luzifer/twitch-bot/twitch" ) type ( diff --git a/config.go b/config.go index 01ed3b0..cbc1e9d 100644 --- a/config.go +++ b/config.go @@ -10,12 +10,13 @@ import ( "sync" "time" - "github.com/Luzifer/twitch-bot/plugins" "github.com/go-irc/irc" "github.com/gofrs/uuid/v3" "github.com/pkg/errors" log "github.com/sirupsen/logrus" "gopkg.in/yaml.v2" + + "github.com/Luzifer/twitch-bot/plugins" ) const expectedMinConfigVersion = 2 diff --git a/configEditor.go b/configEditor.go index ace5932..d980668 100644 --- a/configEditor.go +++ b/configEditor.go @@ -9,10 +9,11 @@ import ( "sync" "time" - "github.com/Luzifer/twitch-bot/plugins" - "github.com/Luzifer/twitch-bot/twitch" "github.com/gorilla/websocket" "github.com/pkg/errors" + + "github.com/Luzifer/twitch-bot/plugins" + "github.com/Luzifer/twitch-bot/twitch" ) const websocketPingInterval = 30 * time.Second diff --git a/configEditor_automessage.go b/configEditor_automessage.go index c7abe82..6b1e1d8 100644 --- a/configEditor_automessage.go +++ b/configEditor_automessage.go @@ -4,11 +4,12 @@ import ( "encoding/json" "net/http" - "github.com/Luzifer/twitch-bot/plugins" "github.com/gofrs/uuid/v3" "github.com/gorilla/mux" "github.com/pkg/errors" log "github.com/sirupsen/logrus" + + "github.com/Luzifer/twitch-bot/plugins" ) func registerEditorAutoMessageRoutes() { diff --git a/configEditor_general.go b/configEditor_general.go index 3f8c81e..5c3897b 100644 --- a/configEditor_general.go +++ b/configEditor_general.go @@ -4,11 +4,12 @@ import ( "encoding/json" "net/http" - "github.com/Luzifer/twitch-bot/plugins" "github.com/gofrs/uuid/v3" "github.com/gorilla/mux" "github.com/pkg/errors" log "github.com/sirupsen/logrus" + + "github.com/Luzifer/twitch-bot/plugins" ) type ( diff --git a/configEditor_global.go b/configEditor_global.go index 267c54c..10936e7 100644 --- a/configEditor_global.go +++ b/configEditor_global.go @@ -6,8 +6,9 @@ import ( "regexp" "time" - "github.com/Luzifer/twitch-bot/plugins" log "github.com/sirupsen/logrus" + + "github.com/Luzifer/twitch-bot/plugins" ) func registerEditorGlobalMethods() { diff --git a/configEditor_rules.go b/configEditor_rules.go index aaf28ea..651ae29 100644 --- a/configEditor_rules.go +++ b/configEditor_rules.go @@ -4,11 +4,12 @@ import ( "encoding/json" "net/http" - "github.com/Luzifer/twitch-bot/plugins" "github.com/gofrs/uuid/v3" "github.com/gorilla/mux" "github.com/pkg/errors" log "github.com/sirupsen/logrus" + + "github.com/Luzifer/twitch-bot/plugins" ) func registerEditorRulesRoutes() { diff --git a/examples/plugin/main.go b/examples/plugin/main.go index e7bc84e..5a46a6b 100644 --- a/examples/plugin/main.go +++ b/examples/plugin/main.go @@ -3,9 +3,10 @@ package main import ( "fmt" - "github.com/Luzifer/twitch-bot/plugins" "github.com/go-irc/irc" "github.com/pkg/errors" + + "github.com/Luzifer/twitch-bot/plugins" ) var _ plugins.RegisterFunc = Register diff --git a/functions.go b/functions.go index 4aa16c8..a3a9b9c 100644 --- a/functions.go +++ b/functions.go @@ -7,10 +7,11 @@ import ( "text/template" "time" - korvike "github.com/Luzifer/korvike/functions" - "github.com/Luzifer/twitch-bot/plugins" "github.com/go-irc/irc" log "github.com/sirupsen/logrus" + + korvike "github.com/Luzifer/korvike/functions" + "github.com/Luzifer/twitch-bot/plugins" ) var tplFuncs = newTemplateFuncProvider() diff --git a/functions_counter.go b/functions_counter.go index a4477bd..8fc8513 100644 --- a/functions_counter.go +++ b/functions_counter.go @@ -3,9 +3,10 @@ package main import ( "strings" - "github.com/Luzifer/twitch-bot/plugins" "github.com/go-irc/irc" "github.com/pkg/errors" + + "github.com/Luzifer/twitch-bot/plugins" ) func init() { diff --git a/functions_irc.go b/functions_irc.go index 089e8f3..c0045d5 100644 --- a/functions_irc.go +++ b/functions_irc.go @@ -3,10 +3,11 @@ package main import ( "strings" - "github.com/Luzifer/twitch-bot/plugins" "github.com/go-irc/irc" "github.com/pkg/errors" log "github.com/sirupsen/logrus" + + "github.com/Luzifer/twitch-bot/plugins" ) func init() { diff --git a/internal/actors/delay/actor.go b/internal/actors/delay/actor.go index 71d6a3a..3210255 100644 --- a/internal/actors/delay/actor.go +++ b/internal/actors/delay/actor.go @@ -4,8 +4,9 @@ import ( "math/rand" "time" - "github.com/Luzifer/twitch-bot/plugins" "github.com/go-irc/irc" + + "github.com/Luzifer/twitch-bot/plugins" ) const actorName = "delay" diff --git a/internal/actors/delete/actor.go b/internal/actors/delete/actor.go index ce777a9..2d3b003 100644 --- a/internal/actors/delete/actor.go +++ b/internal/actors/delete/actor.go @@ -3,9 +3,10 @@ package deleteactor import ( "fmt" - "github.com/Luzifer/twitch-bot/plugins" "github.com/go-irc/irc" "github.com/pkg/errors" + + "github.com/Luzifer/twitch-bot/plugins" ) const actorName = "delete" diff --git a/internal/actors/modchannel/actor.go b/internal/actors/modchannel/actor.go index 21c6b57..47c37b5 100644 --- a/internal/actors/modchannel/actor.go +++ b/internal/actors/modchannel/actor.go @@ -4,10 +4,11 @@ import ( "context" "strings" - "github.com/Luzifer/twitch-bot/plugins" - "github.com/Luzifer/twitch-bot/twitch" "github.com/go-irc/irc" "github.com/pkg/errors" + + "github.com/Luzifer/twitch-bot/plugins" + "github.com/Luzifer/twitch-bot/twitch" ) const actorName = "modchannel" diff --git a/internal/actors/nuke/actor.go b/internal/actors/nuke/actor.go index 05276ad..9c5c2be 100644 --- a/internal/actors/nuke/actor.go +++ b/internal/actors/nuke/actor.go @@ -7,12 +7,13 @@ import ( "sync" "time" - "github.com/Luzifer/go_helpers/v2/str" - "github.com/Luzifer/twitch-bot/plugins" - "github.com/Luzifer/twitch-bot/twitch" "github.com/go-irc/irc" "github.com/pkg/errors" log "github.com/sirupsen/logrus" + + "github.com/Luzifer/go_helpers/v2/str" + "github.com/Luzifer/twitch-bot/plugins" + "github.com/Luzifer/twitch-bot/twitch" ) const ( diff --git a/internal/actors/punish/actor.go b/internal/actors/punish/actor.go index 1e3c997..53628d1 100644 --- a/internal/actors/punish/actor.go +++ b/internal/actors/punish/actor.go @@ -8,9 +8,10 @@ import ( "sync" "time" - "github.com/Luzifer/twitch-bot/plugins" "github.com/go-irc/irc" "github.com/pkg/errors" + + "github.com/Luzifer/twitch-bot/plugins" ) const ( diff --git a/internal/actors/quotedb/actor.go b/internal/actors/quotedb/actor.go index df081f1..62ffae8 100644 --- a/internal/actors/quotedb/actor.go +++ b/internal/actors/quotedb/actor.go @@ -6,9 +6,10 @@ import ( "strconv" "sync" - "github.com/Luzifer/twitch-bot/plugins" "github.com/go-irc/irc" "github.com/pkg/errors" + + "github.com/Luzifer/twitch-bot/plugins" ) const ( diff --git a/internal/actors/quotedb/http.go b/internal/actors/quotedb/http.go index 05414bc..d0176af 100644 --- a/internal/actors/quotedb/http.go +++ b/internal/actors/quotedb/http.go @@ -7,9 +7,10 @@ import ( "strconv" "strings" - "github.com/Luzifer/twitch-bot/plugins" "github.com/gorilla/mux" "github.com/pkg/errors" + + "github.com/Luzifer/twitch-bot/plugins" ) var ( diff --git a/internal/actors/raw/actor.go b/internal/actors/raw/actor.go index 1969be3..e147772 100644 --- a/internal/actors/raw/actor.go +++ b/internal/actors/raw/actor.go @@ -1,9 +1,10 @@ package raw import ( - "github.com/Luzifer/twitch-bot/plugins" "github.com/go-irc/irc" "github.com/pkg/errors" + + "github.com/Luzifer/twitch-bot/plugins" ) const actorName = "raw" diff --git a/internal/actors/respond/actor.go b/internal/actors/respond/actor.go index 937432b..a8180ee 100644 --- a/internal/actors/respond/actor.go +++ b/internal/actors/respond/actor.go @@ -4,10 +4,11 @@ import ( "fmt" "strings" - "github.com/Luzifer/twitch-bot/plugins" "github.com/go-irc/irc" "github.com/pkg/errors" log "github.com/sirupsen/logrus" + + "github.com/Luzifer/twitch-bot/plugins" ) const actorName = "respond" diff --git a/internal/actors/timeout/actor.go b/internal/actors/timeout/actor.go index dc36da5..2e856e1 100644 --- a/internal/actors/timeout/actor.go +++ b/internal/actors/timeout/actor.go @@ -4,9 +4,10 @@ import ( "fmt" "time" - "github.com/Luzifer/twitch-bot/plugins" "github.com/go-irc/irc" "github.com/pkg/errors" + + "github.com/Luzifer/twitch-bot/plugins" ) const actorName = "timeout" diff --git a/internal/actors/whisper/actor.go b/internal/actors/whisper/actor.go index dfecfca..5f7cc5f 100644 --- a/internal/actors/whisper/actor.go +++ b/internal/actors/whisper/actor.go @@ -3,9 +3,10 @@ package whisper import ( "fmt" - "github.com/Luzifer/twitch-bot/plugins" "github.com/go-irc/irc" "github.com/pkg/errors" + + "github.com/Luzifer/twitch-bot/plugins" ) const actorName = "whisper" diff --git a/internal/template/random/random.go b/internal/template/random/random.go index ea62f30..5a65a31 100644 --- a/internal/template/random/random.go +++ b/internal/template/random/random.go @@ -6,8 +6,9 @@ import ( "math" "math/rand" - "github.com/Luzifer/twitch-bot/plugins" "github.com/pkg/errors" + + "github.com/Luzifer/twitch-bot/plugins" ) func Register(args plugins.RegistrationArguments) error { diff --git a/irc.go b/irc.go index fcada84..e65e18d 100644 --- a/irc.go +++ b/irc.go @@ -9,11 +9,12 @@ import ( "sync" "time" - "github.com/Luzifer/twitch-bot/plugins" - "github.com/Luzifer/twitch-bot/twitch" "github.com/go-irc/irc" "github.com/pkg/errors" log "github.com/sirupsen/logrus" + + "github.com/Luzifer/twitch-bot/plugins" + "github.com/Luzifer/twitch-bot/twitch" ) var ( diff --git a/msgformatter.go b/msgformatter.go index 72c7bc5..7052dff 100644 --- a/msgformatter.go +++ b/msgformatter.go @@ -5,9 +5,10 @@ import ( "text/template" "time" - "github.com/Luzifer/twitch-bot/plugins" "github.com/go-irc/irc" "github.com/pkg/errors" + + "github.com/Luzifer/twitch-bot/plugins" ) // Compile-time assertion diff --git a/plugins.go b/plugins.go index 2821400..9fca854 100644 --- a/plugins.go +++ b/plugins.go @@ -9,9 +9,10 @@ import ( "plugin" "strings" - "github.com/Luzifer/twitch-bot/plugins" "github.com/pkg/errors" log "github.com/sirupsen/logrus" + + "github.com/Luzifer/twitch-bot/plugins" ) func loadPlugins(pluginDir string) error { diff --git a/plugins/interface.go b/plugins/interface.go index aa01d0a..b90f708 100644 --- a/plugins/interface.go +++ b/plugins/interface.go @@ -1,10 +1,11 @@ package plugins import ( - "github.com/Luzifer/twitch-bot/twitch" "github.com/go-irc/irc" "github.com/robfig/cron/v3" log "github.com/sirupsen/logrus" + + "github.com/Luzifer/twitch-bot/twitch" ) type ( diff --git a/plugins/rule.go b/plugins/rule.go index 05b2626..416de29 100644 --- a/plugins/rule.go +++ b/plugins/rule.go @@ -6,12 +6,13 @@ import ( "strings" "time" - "github.com/Luzifer/go_helpers/v2/str" - "github.com/Luzifer/twitch-bot/twitch" "github.com/go-irc/irc" "github.com/mitchellh/hashstructure/v2" "github.com/pkg/errors" log "github.com/sirupsen/logrus" + + "github.com/Luzifer/go_helpers/v2/str" + "github.com/Luzifer/twitch-bot/twitch" ) type ( diff --git a/plugins/rule_test.go b/plugins/rule_test.go index f485296..9d7155c 100644 --- a/plugins/rule_test.go +++ b/plugins/rule_test.go @@ -5,9 +5,10 @@ import ( "testing" "time" - "github.com/Luzifer/twitch-bot/twitch" "github.com/go-irc/irc" "github.com/sirupsen/logrus" + + "github.com/Luzifer/twitch-bot/twitch" ) var ( diff --git a/plugins_core.go b/plugins_core.go index 489f758..d393539 100644 --- a/plugins_core.go +++ b/plugins_core.go @@ -4,6 +4,9 @@ import ( "fmt" "net/http" + "github.com/pkg/errors" + log "github.com/sirupsen/logrus" + "github.com/Luzifer/go_helpers/v2/str" "github.com/Luzifer/twitch-bot/internal/actors/ban" "github.com/Luzifer/twitch-bot/internal/actors/delay" @@ -20,8 +23,6 @@ import ( "github.com/Luzifer/twitch-bot/internal/template/random" "github.com/Luzifer/twitch-bot/plugins" "github.com/Luzifer/twitch-bot/twitch" - "github.com/pkg/errors" - log "github.com/sirupsen/logrus" ) var ( diff --git a/store.go b/store.go index de792bc..ef0af1b 100644 --- a/store.go +++ b/store.go @@ -9,8 +9,9 @@ import ( "sync" "time" - "github.com/Luzifer/twitch-bot/plugins" "github.com/pkg/errors" + + "github.com/Luzifer/twitch-bot/plugins" ) const eventSubSecretLength = 32 diff --git a/swagger.go b/swagger.go index 072bc4b..e76fc68 100644 --- a/swagger.go +++ b/swagger.go @@ -8,10 +8,11 @@ import ( "net/http" "strings" - "github.com/Luzifer/twitch-bot/plugins" "github.com/pkg/errors" log "github.com/sirupsen/logrus" "github.com/wzshiming/openapi/spec" + + "github.com/Luzifer/twitch-bot/plugins" ) var ( diff --git a/twitch/eventsub.go b/twitch/eventsub.go index 19afa53..4e13488 100644 --- a/twitch/eventsub.go +++ b/twitch/eventsub.go @@ -15,12 +15,13 @@ import ( "sync" "time" - "github.com/Luzifer/go_helpers/v2/str" "github.com/gofrs/uuid/v3" "github.com/gorilla/mux" "github.com/mitchellh/hashstructure/v2" "github.com/pkg/errors" log "github.com/sirupsen/logrus" + + "github.com/Luzifer/go_helpers/v2/str" ) const ( diff --git a/twitch/twitch.go b/twitch/twitch.go index 5d535a2..847ed2c 100644 --- a/twitch/twitch.go +++ b/twitch/twitch.go @@ -11,9 +11,10 @@ import ( "strconv" "time" - "github.com/Luzifer/go_helpers/v2/backoff" "github.com/pkg/errors" log "github.com/sirupsen/logrus" + + "github.com/Luzifer/go_helpers/v2/backoff" ) const ( diff --git a/twitchWatcher.go b/twitchWatcher.go index 28dbb35..124390a 100644 --- a/twitchWatcher.go +++ b/twitchWatcher.go @@ -4,10 +4,11 @@ import ( "encoding/json" "sync" - "github.com/Luzifer/twitch-bot/plugins" - "github.com/Luzifer/twitch-bot/twitch" "github.com/pkg/errors" log "github.com/sirupsen/logrus" + + "github.com/Luzifer/twitch-bot/plugins" + "github.com/Luzifer/twitch-bot/twitch" ) type ( diff --git a/writeAuth.go b/writeAuth.go index 29a59c6..d8efcd0 100644 --- a/writeAuth.go +++ b/writeAuth.go @@ -4,11 +4,12 @@ import ( "encoding/hex" "net/http" - "github.com/Luzifer/go_helpers/v2/str" "github.com/gofrs/uuid/v3" "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/crypto/bcrypt" + + "github.com/Luzifer/go_helpers/v2/str" ) func fillAuthToken(token *configAuthToken) error {