[lint] Properly format inputs

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-11-25 23:48:16 +01:00
parent e2c6f99f29
commit 8247978151
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D
43 changed files with 97 additions and 54 deletions

View file

@ -5,10 +5,11 @@ import (
"net/http" "net/http"
"strconv" "strconv"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/go-irc/irc" "github.com/go-irc/irc"
"github.com/gorilla/mux" "github.com/gorilla/mux"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/Luzifer/twitch-bot/plugins"
) )
func init() { func init() {

View file

@ -7,10 +7,11 @@ import (
"os" "os"
"os/exec" "os/exec"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/Luzifer/twitch-bot/twitch"
"github.com/go-irc/irc" "github.com/go-irc/irc"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/Luzifer/twitch-bot/twitch"
) )
func init() { func init() {

View file

@ -4,10 +4,11 @@ import (
"fmt" "fmt"
"net/http" "net/http"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/go-irc/irc" "github.com/go-irc/irc"
"github.com/gorilla/mux" "github.com/gorilla/mux"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/Luzifer/twitch-bot/plugins"
) )
func init() { func init() {

View file

@ -3,10 +3,11 @@ package main
import ( import (
"sync" "sync"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/go-irc/irc" "github.com/go-irc/irc"
"github.com/pkg/errors" "github.com/pkg/errors"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/Luzifer/twitch-bot/plugins"
) )
var ( var (

View file

@ -5,8 +5,9 @@ import (
_ "embed" _ "embed"
"text/template" "text/template"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/Luzifer/twitch-bot/plugins"
) )
//go:embed actorDocs.tpl //go:embed actorDocs.tpl

View file

@ -6,13 +6,14 @@ import (
"sync" "sync"
"time" "time"
"github.com/Luzifer/go_helpers/v2/str"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/go-irc/irc" "github.com/go-irc/irc"
"github.com/mitchellh/hashstructure/v2" "github.com/mitchellh/hashstructure/v2"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/robfig/cron/v3" "github.com/robfig/cron/v3"
log "github.com/sirupsen/logrus" 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) var cronParser = cron.NewParser(cron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor)

View file

@ -3,9 +3,10 @@ package main
import ( import (
"net/http" "net/http"
"github.com/pkg/errors"
"github.com/Luzifer/go_helpers/v2/str" "github.com/Luzifer/go_helpers/v2/str"
"github.com/Luzifer/twitch-bot/twitch" "github.com/Luzifer/twitch-bot/twitch"
"github.com/pkg/errors"
) )
func getAuthorizationFromRequest(r *http.Request) (string, *twitch.Client, error) { func getAuthorizationFromRequest(r *http.Request) (string, *twitch.Client, error) {

View file

@ -4,8 +4,9 @@ import (
"strings" "strings"
"sync" "sync"
"github.com/Luzifer/twitch-bot/twitch"
"github.com/go-irc/irc" "github.com/go-irc/irc"
"github.com/Luzifer/twitch-bot/twitch"
) )
type ( type (

View file

@ -10,12 +10,13 @@ import (
"sync" "sync"
"time" "time"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/go-irc/irc" "github.com/go-irc/irc"
"github.com/gofrs/uuid/v3" "github.com/gofrs/uuid/v3"
"github.com/pkg/errors" "github.com/pkg/errors"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"gopkg.in/yaml.v2" "gopkg.in/yaml.v2"
"github.com/Luzifer/twitch-bot/plugins"
) )
const expectedMinConfigVersion = 2 const expectedMinConfigVersion = 2

View file

@ -9,10 +9,11 @@ import (
"sync" "sync"
"time" "time"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/Luzifer/twitch-bot/twitch"
"github.com/gorilla/websocket" "github.com/gorilla/websocket"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/Luzifer/twitch-bot/twitch"
) )
const websocketPingInterval = 30 * time.Second const websocketPingInterval = 30 * time.Second

View file

@ -4,11 +4,12 @@ import (
"encoding/json" "encoding/json"
"net/http" "net/http"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/gofrs/uuid/v3" "github.com/gofrs/uuid/v3"
"github.com/gorilla/mux" "github.com/gorilla/mux"
"github.com/pkg/errors" "github.com/pkg/errors"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/Luzifer/twitch-bot/plugins"
) )
func registerEditorAutoMessageRoutes() { func registerEditorAutoMessageRoutes() {

View file

@ -4,11 +4,12 @@ import (
"encoding/json" "encoding/json"
"net/http" "net/http"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/gofrs/uuid/v3" "github.com/gofrs/uuid/v3"
"github.com/gorilla/mux" "github.com/gorilla/mux"
"github.com/pkg/errors" "github.com/pkg/errors"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/Luzifer/twitch-bot/plugins"
) )
type ( type (

View file

@ -6,8 +6,9 @@ import (
"regexp" "regexp"
"time" "time"
"github.com/Luzifer/twitch-bot/plugins"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/Luzifer/twitch-bot/plugins"
) )
func registerEditorGlobalMethods() { func registerEditorGlobalMethods() {

View file

@ -4,11 +4,12 @@ import (
"encoding/json" "encoding/json"
"net/http" "net/http"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/gofrs/uuid/v3" "github.com/gofrs/uuid/v3"
"github.com/gorilla/mux" "github.com/gorilla/mux"
"github.com/pkg/errors" "github.com/pkg/errors"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/Luzifer/twitch-bot/plugins"
) )
func registerEditorRulesRoutes() { func registerEditorRulesRoutes() {

View file

@ -3,9 +3,10 @@ package main
import ( import (
"fmt" "fmt"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/go-irc/irc" "github.com/go-irc/irc"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/Luzifer/twitch-bot/plugins"
) )
var _ plugins.RegisterFunc = Register var _ plugins.RegisterFunc = Register

View file

@ -7,10 +7,11 @@ import (
"text/template" "text/template"
"time" "time"
korvike "github.com/Luzifer/korvike/functions"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/go-irc/irc" "github.com/go-irc/irc"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
korvike "github.com/Luzifer/korvike/functions"
"github.com/Luzifer/twitch-bot/plugins"
) )
var tplFuncs = newTemplateFuncProvider() var tplFuncs = newTemplateFuncProvider()

View file

@ -3,9 +3,10 @@ package main
import ( import (
"strings" "strings"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/go-irc/irc" "github.com/go-irc/irc"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/Luzifer/twitch-bot/plugins"
) )
func init() { func init() {

View file

@ -3,10 +3,11 @@ package main
import ( import (
"strings" "strings"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/go-irc/irc" "github.com/go-irc/irc"
"github.com/pkg/errors" "github.com/pkg/errors"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/Luzifer/twitch-bot/plugins"
) )
func init() { func init() {

View file

@ -4,8 +4,9 @@ import (
"math/rand" "math/rand"
"time" "time"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/go-irc/irc" "github.com/go-irc/irc"
"github.com/Luzifer/twitch-bot/plugins"
) )
const actorName = "delay" const actorName = "delay"

View file

@ -3,9 +3,10 @@ package deleteactor
import ( import (
"fmt" "fmt"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/go-irc/irc" "github.com/go-irc/irc"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/Luzifer/twitch-bot/plugins"
) )
const actorName = "delete" const actorName = "delete"

View file

@ -4,10 +4,11 @@ import (
"context" "context"
"strings" "strings"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/Luzifer/twitch-bot/twitch"
"github.com/go-irc/irc" "github.com/go-irc/irc"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/Luzifer/twitch-bot/twitch"
) )
const actorName = "modchannel" const actorName = "modchannel"

View file

@ -7,12 +7,13 @@ import (
"sync" "sync"
"time" "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/go-irc/irc"
"github.com/pkg/errors" "github.com/pkg/errors"
log "github.com/sirupsen/logrus" 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 ( const (

View file

@ -8,9 +8,10 @@ import (
"sync" "sync"
"time" "time"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/go-irc/irc" "github.com/go-irc/irc"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/Luzifer/twitch-bot/plugins"
) )
const ( const (

View file

@ -6,9 +6,10 @@ import (
"strconv" "strconv"
"sync" "sync"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/go-irc/irc" "github.com/go-irc/irc"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/Luzifer/twitch-bot/plugins"
) )
const ( const (

View file

@ -7,9 +7,10 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/gorilla/mux" "github.com/gorilla/mux"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/Luzifer/twitch-bot/plugins"
) )
var ( var (

View file

@ -1,9 +1,10 @@
package raw package raw
import ( import (
"github.com/Luzifer/twitch-bot/plugins"
"github.com/go-irc/irc" "github.com/go-irc/irc"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/Luzifer/twitch-bot/plugins"
) )
const actorName = "raw" const actorName = "raw"

View file

@ -4,10 +4,11 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/go-irc/irc" "github.com/go-irc/irc"
"github.com/pkg/errors" "github.com/pkg/errors"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/Luzifer/twitch-bot/plugins"
) )
const actorName = "respond" const actorName = "respond"

View file

@ -4,9 +4,10 @@ import (
"fmt" "fmt"
"time" "time"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/go-irc/irc" "github.com/go-irc/irc"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/Luzifer/twitch-bot/plugins"
) )
const actorName = "timeout" const actorName = "timeout"

View file

@ -3,9 +3,10 @@ package whisper
import ( import (
"fmt" "fmt"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/go-irc/irc" "github.com/go-irc/irc"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/Luzifer/twitch-bot/plugins"
) )
const actorName = "whisper" const actorName = "whisper"

View file

@ -6,8 +6,9 @@ import (
"math" "math"
"math/rand" "math/rand"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/Luzifer/twitch-bot/plugins"
) )
func Register(args plugins.RegistrationArguments) error { func Register(args plugins.RegistrationArguments) error {

5
irc.go
View file

@ -9,11 +9,12 @@ import (
"sync" "sync"
"time" "time"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/Luzifer/twitch-bot/twitch"
"github.com/go-irc/irc" "github.com/go-irc/irc"
"github.com/pkg/errors" "github.com/pkg/errors"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/Luzifer/twitch-bot/twitch"
) )
var ( var (

View file

@ -5,9 +5,10 @@ import (
"text/template" "text/template"
"time" "time"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/go-irc/irc" "github.com/go-irc/irc"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/Luzifer/twitch-bot/plugins"
) )
// Compile-time assertion // Compile-time assertion

View file

@ -9,9 +9,10 @@ import (
"plugin" "plugin"
"strings" "strings"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/pkg/errors" "github.com/pkg/errors"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/Luzifer/twitch-bot/plugins"
) )
func loadPlugins(pluginDir string) error { func loadPlugins(pluginDir string) error {

View file

@ -1,10 +1,11 @@
package plugins package plugins
import ( import (
"github.com/Luzifer/twitch-bot/twitch"
"github.com/go-irc/irc" "github.com/go-irc/irc"
"github.com/robfig/cron/v3" "github.com/robfig/cron/v3"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/Luzifer/twitch-bot/twitch"
) )
type ( type (

View file

@ -6,12 +6,13 @@ import (
"strings" "strings"
"time" "time"
"github.com/Luzifer/go_helpers/v2/str"
"github.com/Luzifer/twitch-bot/twitch"
"github.com/go-irc/irc" "github.com/go-irc/irc"
"github.com/mitchellh/hashstructure/v2" "github.com/mitchellh/hashstructure/v2"
"github.com/pkg/errors" "github.com/pkg/errors"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/Luzifer/go_helpers/v2/str"
"github.com/Luzifer/twitch-bot/twitch"
) )
type ( type (

View file

@ -5,9 +5,10 @@ import (
"testing" "testing"
"time" "time"
"github.com/Luzifer/twitch-bot/twitch"
"github.com/go-irc/irc" "github.com/go-irc/irc"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/Luzifer/twitch-bot/twitch"
) )
var ( var (

View file

@ -4,6 +4,9 @@ import (
"fmt" "fmt"
"net/http" "net/http"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"github.com/Luzifer/go_helpers/v2/str" "github.com/Luzifer/go_helpers/v2/str"
"github.com/Luzifer/twitch-bot/internal/actors/ban" "github.com/Luzifer/twitch-bot/internal/actors/ban"
"github.com/Luzifer/twitch-bot/internal/actors/delay" "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/internal/template/random"
"github.com/Luzifer/twitch-bot/plugins" "github.com/Luzifer/twitch-bot/plugins"
"github.com/Luzifer/twitch-bot/twitch" "github.com/Luzifer/twitch-bot/twitch"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
) )
var ( var (

View file

@ -9,8 +9,9 @@ import (
"sync" "sync"
"time" "time"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/Luzifer/twitch-bot/plugins"
) )
const eventSubSecretLength = 32 const eventSubSecretLength = 32

View file

@ -8,10 +8,11 @@ import (
"net/http" "net/http"
"strings" "strings"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/pkg/errors" "github.com/pkg/errors"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/wzshiming/openapi/spec" "github.com/wzshiming/openapi/spec"
"github.com/Luzifer/twitch-bot/plugins"
) )
var ( var (

View file

@ -15,12 +15,13 @@ import (
"sync" "sync"
"time" "time"
"github.com/Luzifer/go_helpers/v2/str"
"github.com/gofrs/uuid/v3" "github.com/gofrs/uuid/v3"
"github.com/gorilla/mux" "github.com/gorilla/mux"
"github.com/mitchellh/hashstructure/v2" "github.com/mitchellh/hashstructure/v2"
"github.com/pkg/errors" "github.com/pkg/errors"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/Luzifer/go_helpers/v2/str"
) )
const ( const (

View file

@ -11,9 +11,10 @@ import (
"strconv" "strconv"
"time" "time"
"github.com/Luzifer/go_helpers/v2/backoff"
"github.com/pkg/errors" "github.com/pkg/errors"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/Luzifer/go_helpers/v2/backoff"
) )
const ( const (

View file

@ -4,10 +4,11 @@ import (
"encoding/json" "encoding/json"
"sync" "sync"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/Luzifer/twitch-bot/twitch"
"github.com/pkg/errors" "github.com/pkg/errors"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/Luzifer/twitch-bot/plugins"
"github.com/Luzifer/twitch-bot/twitch"
) )
type ( type (

View file

@ -4,11 +4,12 @@ import (
"encoding/hex" "encoding/hex"
"net/http" "net/http"
"github.com/Luzifer/go_helpers/v2/str"
"github.com/gofrs/uuid/v3" "github.com/gofrs/uuid/v3"
"github.com/pkg/errors" "github.com/pkg/errors"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"golang.org/x/crypto/bcrypt" "golang.org/x/crypto/bcrypt"
"github.com/Luzifer/go_helpers/v2/str"
) )
func fillAuthToken(token *configAuthToken) error { func fillAuthToken(token *configAuthToken) error {