[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"
"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() {

View file

@ -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() {

View file

@ -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() {

View file

@ -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 (

View file

@ -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

View file

@ -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)

View file

@ -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) {

View file

@ -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 (

View file

@ -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

View file

@ -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

View file

@ -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() {

View file

@ -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 (

View file

@ -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() {

View file

@ -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() {

View file

@ -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

View file

@ -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()

View file

@ -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() {

View file

@ -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() {

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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 (

View file

@ -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 (

View file

@ -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 (

View file

@ -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 (

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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 {

5
irc.go
View file

@ -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 (

View file

@ -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

View file

@ -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 {

View file

@ -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 (

View file

@ -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 (

View file

@ -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 (

View file

@ -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 (

View file

@ -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

View file

@ -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 (

View file

@ -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 (

View file

@ -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 (

View file

@ -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 (

View file

@ -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 {