Skip to content

Commit

Permalink
🎨updates import order
Browse files Browse the repository at this point in the history
  • Loading branch information
Anders Fylling committed Nov 16, 2018
1 parent fc2b585 commit 004138c
Show file tree
Hide file tree
Showing 34 changed files with 92 additions and 56 deletions.
3 changes: 2 additions & 1 deletion auditlog.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package disgord

import (
"net/http"

"github.com/andersfylling/disgord/constant"
"github.com/andersfylling/disgord/endpoint"
"github.com/andersfylling/disgord/httd"
"github.com/andersfylling/disgord/ratelimit"
"github.com/andersfylling/snowflake/v3"
"net/http"
)

// Audit-log event types
Expand Down
7 changes: 4 additions & 3 deletions auditlog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package disgord

import (
"errors"
"io/ioutil"
"net/http"
"testing"

"github.com/andersfylling/disgord/endpoint"
"github.com/andersfylling/disgord/httd"
"github.com/andersfylling/disgord/ratelimit"
"github.com/andersfylling/snowflake/v3"
"io/ioutil"
"net/http"
"testing"
)

func TestAuditLogConvertAuditLogParamsToStr(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package disgord

import (
"errors"
"time"

"github.com/andersfylling/disgord/httd"
"github.com/andersfylling/snowflake/v3"
"time"

"github.com/andersfylling/disgord/cache/interfaces"
"github.com/andersfylling/disgord/cache/lfu"
Expand Down
3 changes: 2 additions & 1 deletion cache/benchmarks_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package cache

import (
"testing"

"github.com/andersfylling/disgord/cache/interfaces"
"github.com/andersfylling/disgord/cache/lfu"
"github.com/andersfylling/disgord/cache/lru"
"testing"
)

type Snowflake = interfaces.Snowflake
Expand Down
3 changes: 2 additions & 1 deletion channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package disgord

import (
"errors"
"github.com/andersfylling/disgord/constant"
"strconv"
"time"

"github.com/andersfylling/disgord/constant"
)

// Channel types
Expand Down
3 changes: 2 additions & 1 deletion channel_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package disgord

import (
"github.com/andersfylling/disgord/httd"
"io/ioutil"
"testing"

"github.com/andersfylling/disgord/httd"
)

func TestChannel_InterfaceImplementations(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import (
"context"
"errors"
"fmt"
"github.com/andersfylling/disgord/constant"
"github.com/andersfylling/disgord/websocket"
"net/http"
"os"
"os/signal"
Expand All @@ -14,6 +12,9 @@ import (
"syscall"
"time"

"github.com/andersfylling/disgord/constant"
"github.com/andersfylling/disgord/websocket"

"github.com/andersfylling/disgord/event"
"github.com/andersfylling/disgord/httd"
"github.com/sirupsen/logrus"
Expand Down
3 changes: 2 additions & 1 deletion disgord.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,10 @@ package disgord

import (
"errors"
"strings"

"github.com/andersfylling/disgord/constant"
"github.com/andersfylling/snowflake/v3"
"strings"
)

// LibraryInfo returns name + version
Expand Down
5 changes: 3 additions & 2 deletions disgord_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package disgord

import (
"github.com/andersfylling/disgord/event"
"github.com/andersfylling/disgord/websocket"
"net/http"
"strconv"
"sync"
"testing"
"time"

"github.com/andersfylling/disgord/event"
"github.com/andersfylling/disgord/websocket"
)

func TestValidateUsername(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions emoji.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package disgord

import (
"errors"
"net/http"
"strings"

"github.com/andersfylling/disgord/constant"
"github.com/andersfylling/disgord/endpoint"
"github.com/andersfylling/disgord/httd"
"github.com/andersfylling/disgord/ratelimit"
"github.com/andersfylling/snowflake/v3"
"net/http"
"strings"
)

// Emoji ...
Expand Down
9 changes: 5 additions & 4 deletions emoji_test.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package disgord

import (
"github.com/andersfylling/disgord/constant"
"github.com/andersfylling/disgord/endpoint"
"github.com/andersfylling/disgord/httd"
"github.com/andersfylling/disgord/ratelimit"
"net/http"
"os"
"strings"
"testing"
"time"

"github.com/andersfylling/disgord/constant"
"github.com/andersfylling/disgord/endpoint"
"github.com/andersfylling/disgord/httd"
"github.com/andersfylling/disgord/ratelimit"
)

func TestEmoji_InterfaceImplementations(t *testing.T) {
Expand Down
5 changes: 4 additions & 1 deletion httd/json_std.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

package httd

import "encoding/json"
import (
"encoding/json"
"io"
)

// Unmarshal is the json unmarshalling implementation that is defined by the used build tags.
func Unmarshal(data []byte, v interface{}) error {
Expand Down
3 changes: 2 additions & 1 deletion invite.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package disgord

import (
"net/http"

"github.com/andersfylling/disgord/constant"
"github.com/andersfylling/disgord/endpoint"
"github.com/andersfylling/disgord/httd"
"github.com/andersfylling/disgord/ratelimit"
"net/http"
)

// PartialInvite ...
Expand Down
7 changes: 4 additions & 3 deletions message.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ import (
"bytes"
"encoding/json"
"errors"
"github.com/andersfylling/disgord/constant"
"github.com/andersfylling/disgord/endpoint"
"github.com/andersfylling/disgord/httd"
"io"
"mime/multipart"
"net/http"
"strconv"
"sync"
"time"

"github.com/andersfylling/disgord/constant"
"github.com/andersfylling/disgord/endpoint"
"github.com/andersfylling/disgord/httd"
)

// different message acticity types
Expand Down
5 changes: 3 additions & 2 deletions reaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package disgord

import (
"errors"
"net/http"
"strconv"

"github.com/andersfylling/disgord/constant"
"github.com/andersfylling/disgord/endpoint"
"github.com/andersfylling/disgord/httd"
"net/http"
"strconv"
)

// Reaction ...
Expand Down
5 changes: 3 additions & 2 deletions rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package disgord

import (
"encoding/json"
"github.com/andersfylling/disgord/httd"
"github.com/andersfylling/snowflake/v3"
"net/http"
"strconv"

"github.com/andersfylling/disgord/httd"
"github.com/andersfylling/snowflake/v3"
)

type ErrRest = httd.ErrREST
Expand Down
3 changes: 2 additions & 1 deletion rest_channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package disgord
import (
"encoding/json"
"errors"
"net/http"

"github.com/andersfylling/disgord/endpoint"
"github.com/andersfylling/disgord/httd"
"net/http"
)

func ratelimitChannel(id Snowflake) string {
Expand Down
3 changes: 2 additions & 1 deletion role.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package disgord

import (
"errors"
"net/http"

"github.com/andersfylling/disgord/constant"
"github.com/andersfylling/disgord/endpoint"
"github.com/andersfylling/disgord/httd"
"net/http"
)

// NewRole ...
Expand Down
3 changes: 2 additions & 1 deletion session.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package disgord

import (
"errors"
"github.com/andersfylling/disgord/event"
"net/http"
"time"

"github.com/andersfylling/disgord/event"

"github.com/andersfylling/disgord/constant"
"github.com/andersfylling/disgord/httd"
"github.com/andersfylling/disgord/websocket"
Expand Down
3 changes: 2 additions & 1 deletion struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package disgord
import (
"errors"
"fmt"
"github.com/andersfylling/disgord/constant"
"strconv"
"sync"
"time"

"github.com/andersfylling/disgord/constant"
)

// common functionality/types used by struct_*.go files goes here
Expand Down
3 changes: 2 additions & 1 deletion struct_guild.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package disgord
import (
"encoding/json"
"errors"
"github.com/andersfylling/disgord/constant"
"sort"

"github.com/andersfylling/disgord/constant"
)

// consts inspired by: https://github.com/bwmarrin/discordgo/blob/master/structs.go
Expand Down
3 changes: 2 additions & 1 deletion struct_guild_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package disgord

import (
"encoding/json"
"github.com/andersfylling/disgord/httd"
"io/ioutil"
"testing"

"github.com/andersfylling/disgord/httd"
)

func TestGuild_InterfaceImplementations(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions user.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package disgord
import (
"encoding/json"
"errors"
"net/http"
"strconv"

"github.com/andersfylling/disgord/constant"
"github.com/andersfylling/disgord/endpoint"
"github.com/andersfylling/disgord/httd"
"net/http"
"strconv"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package disgord

import (
"fmt"
"github.com/andersfylling/disgord/httd"
"io/ioutil"
"testing"

"github.com/andersfylling/disgord/httd"
)

func TestUser_InterfaceImplementations(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion voice.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package disgord

import (
"net/http"

"github.com/andersfylling/disgord/constant"
"github.com/andersfylling/disgord/endpoint"
"github.com/andersfylling/disgord/httd"
"github.com/andersfylling/disgord/ratelimit"
"net/http"
)

// VoiceState Voice State structure
Expand Down
7 changes: 4 additions & 3 deletions voice_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package disgord

import (
"github.com/andersfylling/disgord/endpoint"
"github.com/andersfylling/disgord/httd"
"github.com/andersfylling/disgord/ratelimit"
"io/ioutil"
"net/http"
"testing"

"github.com/andersfylling/disgord/endpoint"
"github.com/andersfylling/disgord/httd"
"github.com/andersfylling/disgord/ratelimit"
)

func TestStateMarshalling(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package disgord

import (
"errors"
"net/http"

"github.com/andersfylling/disgord/constant"
"github.com/andersfylling/disgord/endpoint"
"github.com/andersfylling/disgord/httd"
"net/http"
)

// Webhook Used to represent a webhook
Expand Down
3 changes: 2 additions & 1 deletion webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package disgord

import (
"encoding/json"
"github.com/andersfylling/disgord/httd"
"testing"

"github.com/andersfylling/disgord/httd"
)

func getJSONMap(v interface{}) (map[string]*json.RawMessage, error) {
Expand Down
Loading

0 comments on commit 004138c

Please sign in to comment.