Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Format the import order #733

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cmd/redis-shake/main.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
package main

import (
_ "net/http/pprof"

"RedisShake/internal/config"
"RedisShake/internal/function"
"RedisShake/internal/log"
"RedisShake/internal/reader"
"RedisShake/internal/status"
"RedisShake/internal/utils"
"RedisShake/internal/writer"

"github.com/mcuadros/go-defaults"
_ "net/http/pprof"
)

func main() {
Expand Down
5 changes: 3 additions & 2 deletions internal/client/func.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package client

import (
"RedisShake/internal/client/proto"
"RedisShake/internal/log"
"bytes"
"strings"

"RedisShake/internal/client/proto"
"RedisShake/internal/log"
)

func EncodeArgv(argv []string, buf *bytes.Buffer) {
Expand Down
5 changes: 3 additions & 2 deletions internal/client/redis.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package client

import (
"RedisShake/internal/client/proto"
"RedisShake/internal/log"
"bufio"
"crypto/tls"
"net"
"strconv"
"time"

"RedisShake/internal/client/proto"
"RedisShake/internal/log"
)

type Redis struct {
Expand Down
5 changes: 3 additions & 2 deletions internal/commands/keys.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package commands

import (
"RedisShake/internal/log"
"RedisShake/internal/utils"
"fmt"
"math"
"strconv"
"strings"

"RedisShake/internal/log"
"RedisShake/internal/utils"
)

// CalcKeys https://redis.io/docs/reference/key-specs/
Expand Down
8 changes: 5 additions & 3 deletions internal/config/config.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package config

import (
"RedisShake/internal/log"
"fmt"
"os"
"strings"

"RedisShake/internal/log"

"github.com/mcuadros/go-defaults"
"github.com/rs/zerolog"
"github.com/spf13/viper"
"os"
"strings"
)

type AdvancedOptions struct {
Expand Down
5 changes: 3 additions & 2 deletions internal/entry/entry.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package entry

import (
"bytes"
"strings"

"RedisShake/internal/client/proto"
"RedisShake/internal/commands"
"RedisShake/internal/log"
"bytes"
"strings"
)

type Entry struct {
Expand Down
4 changes: 3 additions & 1 deletion internal/function/function.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package function

import (
"strings"

"RedisShake/internal/config"
"RedisShake/internal/entry"
"RedisShake/internal/log"

lua "github.com/yuin/gopher-lua"
"strings"
)

var luaString string
Expand Down
3 changes: 2 additions & 1 deletion internal/log/func.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package log

import (
"github.com/go-stack/stack"
"os"

"github.com/go-stack/stack"
)

func Debugf(format string, args ...interface{}) {
Expand Down
3 changes: 2 additions & 1 deletion internal/log/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package log

import (
"fmt"
"github.com/rs/zerolog"
"os"
"path/filepath"

"github.com/rs/zerolog"
)

var logger zerolog.Logger
Expand Down
13 changes: 7 additions & 6 deletions internal/rdb/rdb.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
package rdb

import (
"RedisShake/internal/config"
"RedisShake/internal/entry"
"RedisShake/internal/log"
"RedisShake/internal/rdb/structure"
"RedisShake/internal/rdb/types"
"RedisShake/internal/utils"
"bufio"
"bytes"
"encoding/binary"
"io"
"os"
"strconv"
"time"

"RedisShake/internal/config"
"RedisShake/internal/entry"
"RedisShake/internal/log"
"RedisShake/internal/rdb/structure"
"RedisShake/internal/rdb/types"
"RedisShake/internal/utils"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion internal/rdb/structure/byte.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package structure

import (
"RedisShake/internal/log"
"io"

"RedisShake/internal/log"
)

func ReadByte(rd io.Reader) byte {
Expand Down
3 changes: 2 additions & 1 deletion internal/rdb/structure/float.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package structure

import (
"RedisShake/internal/log"
"encoding/binary"
"io"
"math"
"strconv"

"RedisShake/internal/log"
)

func ReadFloat(rd io.Reader) float64 {
Expand Down
3 changes: 2 additions & 1 deletion internal/rdb/structure/length.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package structure

import (
"RedisShake/internal/log"
"encoding/binary"
"fmt"
"io"

"RedisShake/internal/log"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion internal/rdb/structure/listpack.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package structure

import (
"RedisShake/internal/log"
"bufio"
"io"
"math"
"strconv"
"strings"

"RedisShake/internal/log"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion internal/rdb/structure/string.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package structure

import (
"RedisShake/internal/log"
"io"
"strconv"

"RedisShake/internal/log"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion internal/rdb/structure/ziplist.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package structure

import (
"RedisShake/internal/log"
"bufio"
"encoding/binary"
"io"
"strconv"
"strings"

"RedisShake/internal/log"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion internal/rdb/types/hash.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package types

import (
"io"

"RedisShake/internal/log"
"RedisShake/internal/rdb/structure"
"io"
)

type HashObject struct {
Expand Down
3 changes: 2 additions & 1 deletion internal/rdb/types/interface.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package types

import (
"RedisShake/internal/log"
"io"

"RedisShake/internal/log"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion internal/rdb/types/list.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package types

import (
"io"

"RedisShake/internal/log"
"RedisShake/internal/rdb/structure"
"io"
)

// quicklist node container formats
Expand Down
5 changes: 3 additions & 2 deletions internal/rdb/types/mbbloom.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package types

import (
"RedisShake/internal/config"
"RedisShake/internal/rdb/structure"
"io"
"strconv"
"unsafe"

"RedisShake/internal/config"
"RedisShake/internal/rdb/structure"
)

// BloomObject for MBbloom-- at https://github.com/RedisBloom/RedisBloom
Expand Down
3 changes: 2 additions & 1 deletion internal/rdb/types/set.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package types

import (
"io"

"RedisShake/internal/log"
"RedisShake/internal/rdb/structure"
"io"
)

type SetObject struct {
Expand Down
5 changes: 3 additions & 2 deletions internal/rdb/types/stream.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package types

import (
"RedisShake/internal/log"
"RedisShake/internal/rdb/structure"
"encoding/binary"
"fmt"
"io"
"strconv"

"RedisShake/internal/log"
"RedisShake/internal/rdb/structure"
)

/*
Expand Down
3 changes: 2 additions & 1 deletion internal/rdb/types/string.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package types

import (
"RedisShake/internal/rdb/structure"
"io"

"RedisShake/internal/rdb/structure"
)

type StringObject struct {
Expand Down
5 changes: 3 additions & 2 deletions internal/rdb/types/zset.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package types

import (
"RedisShake/internal/log"
"RedisShake/internal/rdb/structure"
"fmt"
"io"

"RedisShake/internal/log"
"RedisShake/internal/rdb/structure"
)

type ZSetEntry struct {
Expand Down
5 changes: 3 additions & 2 deletions internal/reader/aof_reader.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package reader

import (
"RedisShake/internal/aof"
"path/filepath"

"RedisShake/internal/aof"

"RedisShake/internal/entry"
"RedisShake/internal/log"
"RedisShake/internal/utils"
Expand Down Expand Up @@ -101,4 +102,4 @@ func (r *aofReader) StartRead() chan *entry.Entry {
}()

return r.ch
}
}
7 changes: 4 additions & 3 deletions internal/reader/parsing_aof.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package reader

import (
"RedisShake/internal/aof"
"RedisShake/internal/entry"
"RedisShake/internal/log"
"bufio"
"bytes"
"container/list"
Expand All @@ -16,6 +13,10 @@ import (
"strings"
"time"
"unicode"

"RedisShake/internal/aof"
"RedisShake/internal/entry"
"RedisShake/internal/log"
)

const (
Expand Down
Loading
Loading