go fmt + gci

Signed-off-by: Cléo Rebert <cleo.rebert@gmail.com>
This commit is contained in:
Cléo Rebert 2023-09-19 17:25:48 +02:00 committed by Diamond
parent d36955acea
commit 8f548d2607
32 changed files with 46 additions and 56 deletions

View File

@ -2,6 +2,7 @@ package main
import (
"context"
"errors"
"flag"
"log"
"os"
@ -16,7 +17,6 @@ import (
"github.com/diamondburned/arikawa/v3/voice"
"github.com/diamondburned/arikawa/v3/voice/udp"
"github.com/diamondburned/oggreader"
"errors"
)
func main() {

View File

@ -2,6 +2,7 @@ package cmdroute
import (
"fmt"
"github.com/diamondburned/arikawa/v3/api"
"github.com/diamondburned/arikawa/v3/discord"
)

View File

@ -3,10 +3,10 @@ package api
import (
"bytes"
"encoding/base64"
"errors"
"fmt"
"net/http"
"errors"
"github.com/diamondburned/arikawa/v3/utils/json"
)

View File

@ -2,10 +2,11 @@ package api
import (
"fmt"
"mime/multipart"
"github.com/diamondburned/arikawa/v3/discord"
"github.com/diamondburned/arikawa/v3/utils/json/option"
"github.com/diamondburned/arikawa/v3/utils/sendpart"
"mime/multipart"
)
var EndpointInteractions = Endpoint + "interactions/"

View File

@ -2,12 +2,13 @@ package api
import (
"fmt"
"mime/multipart"
"github.com/diamondburned/arikawa/v3/discord"
"github.com/diamondburned/arikawa/v3/internal/intmath"
"github.com/diamondburned/arikawa/v3/utils/httputil"
"github.com/diamondburned/arikawa/v3/utils/json/option"
"github.com/diamondburned/arikawa/v3/utils/sendpart"
"mime/multipart"
)
const (

View File

@ -2,6 +2,7 @@ package rate
import (
"context"
"errors"
"fmt"
"net/http"
"strconv"
@ -10,7 +11,6 @@ import (
"sync/atomic"
"time"
"errors"
"github.com/diamondburned/arikawa/v3/internal/moreatomic"
)

View File

@ -5,13 +5,13 @@ import (
"crypto/ed25519"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
"errors"
"github.com/diamondburned/arikawa/v3/api"
"github.com/diamondburned/arikawa/v3/discord"
)

View File

@ -4,14 +4,13 @@ package webhook
import (
"context"
"errors"
"fmt"
"mime/multipart"
"net/url"
"regexp"
"strconv"
"errors"
"github.com/diamondburned/arikawa/v3/api"
"github.com/diamondburned/arikawa/v3/api/rate"
"github.com/diamondburned/arikawa/v3/discord"

View File

@ -1,26 +1,26 @@
// Package arikawa contains a set of modular packages that allows you to make a
// Discord bot or any type of session (OAuth unsupported).
//
// Session
// # Session
//
// Package session is the most simple abstraction, which combines the API
// package and the Gateway websocket package together into one. This could be
// used for minimal bots that only use gateway events and such.
//
// State
// # State
//
// Package state abstracts on top of session and provides a local cache of API
// calls and events. Bots that either don't need a command router or already has
// its own should use this package.
//
// Bot
// # Bot
//
// Package bot abstracts on top of state and provides a command router based on
// Go code. This is similar to discord.py's API, only it's Go and there's no
// optional arguments (yet, although it could be worked around). Most bots are
// recommended to use this package, as it's the easiest way to make a bot.
//
// Voice
// # Voice
//
// Package voice provides an abstraction on top of State and adds voice support.
// This allows bots to join voice channels and talk. The package uses an
@ -29,12 +29,11 @@
package arikawa
import (
// Low level packages.
_ "github.com/diamondburned/arikawa/v3/api"
_ "github.com/diamondburned/arikawa/v3/gateway"
// Packages that most should use.
_ "github.com/diamondburned/arikawa/v3/session"
_ "github.com/diamondburned/arikawa/v3/state"
_ "github.com/diamondburned/arikawa/v3/voice"
// Low level packages.
_ "github.com/diamondburned/arikawa/v3/api"
_ "github.com/diamondburned/arikawa/v3/gateway"
)

View File

@ -1,11 +1,11 @@
package discord
import (
"errors"
"fmt"
"reflect"
"strings"
"errors"
"github.com/diamondburned/arikawa/v3/internal/rfutil"
"github.com/diamondburned/arikawa/v3/utils/json"
)

View File

@ -4,6 +4,7 @@
package testenv
import (
"errors"
"fmt"
"os"
"strconv"
@ -11,7 +12,6 @@ import (
"testing"
"time"
"errors"
"github.com/diamondburned/arikawa/v3/discord"
)

View File

@ -4,10 +4,9 @@ package zlib
import (
"bytes"
"errors"
"fmt"
"log"
"errors"
)
var Suffix = [4]byte{'\x00', '\x00', '\xff', '\xff'}

View File

@ -5,12 +5,11 @@ package session
import (
"context"
"errors"
"fmt"
"log"
"sync"
"errors"
"github.com/diamondburned/arikawa/v3/api"
"github.com/diamondburned/arikawa/v3/api/webhook"
"github.com/diamondburned/arikawa/v3/gateway"

View File

@ -4,6 +4,7 @@ package state
import (
"context"
"errors"
"fmt"
"sync"
@ -15,8 +16,6 @@ import (
"github.com/diamondburned/arikawa/v3/state/store"
"github.com/diamondburned/arikawa/v3/state/store/defaultstore"
"github.com/diamondburned/arikawa/v3/utils/handler"
"errors"
)
var (

View File

@ -1,7 +1,7 @@
// Package store contains interfaces of the state's storage and its
// implementations.
//
// Getter Methods
// # Getter Methods
//
// All getter methods will be wrapped by the State. If the State can't find
// anything in the storage, it will call the API itself and automatically add
@ -15,7 +15,7 @@
// Getter methods should not care about returning slices in order, unless
// explicitly stated against.
//
// ErrNotFound Rules
// # ErrNotFound Rules
//
// If a getter method cannot find something, it should return ErrNotFound.
// Callers including State may check if the error is ErrNotFound to do something
@ -27,7 +27,7 @@
// ErrNotFound when either happens. This will make State refetch from the API,
// so it is not ideal.
//
// Remove Methods
// # Remove Methods
//
// Remove methods should return a nil error if the item it wants to delete is
// not found. This helps save some additional work in some cases.

View File

@ -8,11 +8,11 @@ import (
"strings"
"time"
"github.com/diamondburned/arikawa/v3/discord"
"github.com/diamondburned/arikawa/v3/gateway"
"github.com/diamondburned/arikawa/v3/utils/bot"
"github.com/diamondburned/arikawa/v3/utils/bot/extras/arguments"
"github.com/diamondburned/arikawa/v3/utils/bot/extras/middlewares"
"github.com/diamondburned/arikawa/v3/discord"
"github.com/diamondburned/arikawa/v3/gateway"
)
type Bot struct {

View File

@ -6,9 +6,9 @@ import (
"runtime"
"strings"
"github.com/diamondburned/arikawa/v3/gateway"
"github.com/diamondburned/arikawa/v3/utils/bot"
"github.com/diamondburned/arikawa/v3/utils/bot/extras/middlewares"
"github.com/diamondburned/arikawa/v3/gateway"
)
// Flag for administrators only.

View File

@ -2,6 +2,7 @@ package bot
import (
"context"
"errors"
"fmt"
"log"
"os"
@ -11,8 +12,6 @@ import (
"syscall"
"time"
"errors"
"github.com/diamondburned/arikawa/v3/api"
"github.com/diamondburned/arikawa/v3/gateway"
"github.com/diamondburned/arikawa/v3/session"

View File

@ -1,6 +1,7 @@
package bot
import (
"errors"
"reflect"
"strings"
@ -8,7 +9,6 @@ import (
"github.com/diamondburned/arikawa/v3/discord"
"github.com/diamondburned/arikawa/v3/gateway"
"github.com/diamondburned/arikawa/v3/utils/json/option"
"errors"
)
// Break is a non-fatal error that could be returned from middlewares to stop

View File

@ -1,9 +1,9 @@
package middlewares
import (
"github.com/diamondburned/arikawa/v3/discord"
"github.com/diamondburned/arikawa/v3/utils/bot"
"github.com/diamondburned/arikawa/v3/utils/bot/extras/infer"
"github.com/diamondburned/arikawa/v3/discord"
)
func AdminOnly(ctx *bot.Context) func(interface{}) error {

View File

@ -1,13 +1,12 @@
package bot
import (
"errors"
"fmt"
"reflect"
"runtime"
"strings"
"errors"
"github.com/diamondburned/arikawa/v3/gateway"
)

View File

@ -2,6 +2,7 @@ package main
import (
"bytes"
_ "embed"
"flag"
"fmt"
"go/format"
@ -12,8 +13,6 @@ import (
"strings"
"text/template"
"unicode"
_ "embed"
)
var (

View File

@ -2,14 +2,13 @@ package main
import (
"bytes"
_ "embed"
"flag"
"go/format"
"log"
"os"
"path/filepath"
"text/template"
_ "embed"
)
type data struct {

View File

@ -18,11 +18,10 @@ package handler
import (
"context"
"errors"
"fmt"
"reflect"
"sync"
"errors"
)
// Handler is a container for command handlers. A zero-value instance is a valid

View File

@ -3,13 +3,13 @@ package ws
import (
"compress/zlib"
"context"
"errors"
"fmt"
"io"
"net/http"
"sync"
"time"
"errors"
"github.com/gorilla/websocket"
)

View File

@ -2,11 +2,11 @@ package ws
import (
"context"
"errors"
"fmt"
"sync"
"time"
"errors"
"github.com/diamondburned/arikawa/v3/internal/lazytime"
"github.com/diamondburned/arikawa/v3/utils/json"
)

View File

@ -2,11 +2,11 @@ package ws
import (
"context"
"errors"
"fmt"
"sync"
"github.com/diamondburned/arikawa/v3/utils/json"
"errors"
)
// OpCode is the type for websocket Op codes. Op codes less than 0 are

View File

@ -2,21 +2,19 @@ package voice
import (
"context"
"errors"
"fmt"
"sync"
"time"
"github.com/diamondburned/arikawa/v3/state"
"github.com/diamondburned/arikawa/v3/utils/handler"
"github.com/diamondburned/arikawa/v3/utils/ws/ophandler"
"errors"
"github.com/diamondburned/arikawa/v3/discord"
"github.com/diamondburned/arikawa/v3/gateway"
"github.com/diamondburned/arikawa/v3/internal/moreatomic"
"github.com/diamondburned/arikawa/v3/session"
"github.com/diamondburned/arikawa/v3/state"
"github.com/diamondburned/arikawa/v3/utils/handler"
"github.com/diamondburned/arikawa/v3/utils/ws"
"github.com/diamondburned/arikawa/v3/utils/ws/ophandler"
"github.com/diamondburned/arikawa/v3/voice/udp"
"github.com/diamondburned/arikawa/v3/voice/voicegateway"
)

View File

@ -2,6 +2,7 @@ package voice
import (
"context"
"errors"
"fmt"
"log"
"math/rand"
@ -12,7 +13,6 @@ import (
"testing"
"time"
"errors"
"github.com/diamondburned/arikawa/v3/api"
"github.com/diamondburned/arikawa/v3/discord"
"github.com/diamondburned/arikawa/v3/internal/testenv"

View File

@ -4,13 +4,13 @@ import (
"bytes"
"context"
"encoding/binary"
"errors"
"fmt"
"io"
"net"
"sync"
"time"
"errors"
"golang.org/x/crypto/nacl/secretbox"
)

View File

@ -2,11 +2,11 @@ package udp
import (
"context"
"errors"
"fmt"
"sync"
"time"
"errors"
"github.com/diamondburned/arikawa/v3/utils/ws"
)

View File

@ -11,12 +11,11 @@ package voicegateway
import (
"context"
"errors"
"strings"
"sync"
"time"
"errors"
"github.com/diamondburned/arikawa/v3/discord"
"github.com/diamondburned/arikawa/v3/utils/ws"
)