Skip to content

Commit

Permalink
style: 排序imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Redmomn committed Nov 29, 2024
1 parent ab371c1 commit 192b8c8
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 78 deletions.
4 changes: 1 addition & 3 deletions cmd/gocq/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ import (
"strings"
"time"

"github.com/Mrs4s/go-cqhttp/internal/download"

"github.com/LagrangeDev/LagrangeGo/client"
"github.com/LagrangeDev/LagrangeGo/client/auth"
"github.com/LagrangeDev/LagrangeGo/client/packets/wtlogin/qrcodestate"
"github.com/LagrangeDev/LagrangeGo/utils"

"github.com/Mrs4s/go-cqhttp/internal/download"
"github.com/mattn/go-colorable"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
Expand Down
19 changes: 8 additions & 11 deletions cmd/gocq/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,26 @@ import (
"sync"
"time"

"github.com/LagrangeDev/LagrangeGo/client"
"github.com/LagrangeDev/LagrangeGo/client/auth"
"github.com/LagrangeDev/LagrangeGo/client/packets/pb/action"
"github.com/LagrangeDev/LagrangeGo/utils"
"github.com/LagrangeDev/LagrangeGo/utils/crypto"
"github.com/Mrs4s/go-cqhttp/internal/selfdiagnosis"

"github.com/LagrangeDev/LagrangeGo/client/auth"

"github.com/LagrangeDev/LagrangeGo/client"
para "github.com/fumiama/go-hide-param"
rotatelogs "github.com/lestrrat-go/file-rotatelogs"
log "github.com/sirupsen/logrus"
"golang.org/x/crypto/pbkdf2"
"golang.org/x/term"

"github.com/Mrs4s/go-cqhttp/coolq"
"github.com/Mrs4s/go-cqhttp/db"
"github.com/Mrs4s/go-cqhttp/global"
"github.com/Mrs4s/go-cqhttp/global/terminal"
"github.com/Mrs4s/go-cqhttp/internal/base"
"github.com/Mrs4s/go-cqhttp/internal/cache"
"github.com/Mrs4s/go-cqhttp/internal/selfdiagnosis"
"github.com/Mrs4s/go-cqhttp/internal/selfupdate"
"github.com/Mrs4s/go-cqhttp/modules/servers"
"github.com/Mrs4s/go-cqhttp/server"
para "github.com/fumiama/go-hide-param"
rotatelogs "github.com/lestrrat-go/file-rotatelogs"
log "github.com/sirupsen/logrus"
"golang.org/x/crypto/pbkdf2"
"golang.org/x/term"
)

// InitBase 解析参数并检测
Expand Down
21 changes: 8 additions & 13 deletions coolq/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,30 @@ import (
"errors"
"fmt"
"math"
"strconv"
"time"

"github.com/LagrangeDev/LagrangeGo/client/sign"

"github.com/Mrs4s/go-cqhttp/internal/msg"

"github.com/LagrangeDev/LagrangeGo/client/entity"

"os"
"path"
"path/filepath"
"runtime"
"strconv"
"strings"
"time"

"github.com/LagrangeDev/LagrangeGo/client/entity"
"github.com/LagrangeDev/LagrangeGo/client/sign"
"github.com/LagrangeDev/LagrangeGo/message"
"github.com/LagrangeDev/LagrangeGo/utils/binary"
log "github.com/sirupsen/logrus"
"github.com/tidwall/gjson"

"github.com/LagrangeDev/LagrangeGo/utils"
"github.com/LagrangeDev/LagrangeGo/utils/binary"
"github.com/Mrs4s/go-cqhttp/db"
"github.com/Mrs4s/go-cqhttp/global"
"github.com/Mrs4s/go-cqhttp/internal/base"
"github.com/Mrs4s/go-cqhttp/internal/cache"
"github.com/Mrs4s/go-cqhttp/internal/download"
"github.com/Mrs4s/go-cqhttp/internal/msg"
"github.com/Mrs4s/go-cqhttp/internal/param"
"github.com/Mrs4s/go-cqhttp/modules/filter"
"github.com/Mrs4s/go-cqhttp/pkg/onebot"
log "github.com/sirupsen/logrus"
"github.com/tidwall/gjson"
)

// CQGetLoginInfo 获取登录号信息
Expand Down
3 changes: 1 addition & 2 deletions coolq/api_v12.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ package coolq
import (
"runtime"

"github.com/tidwall/gjson"

"github.com/Mrs4s/go-cqhttp/global"
"github.com/Mrs4s/go-cqhttp/internal/base"
"github.com/tidwall/gjson"
)

// CQGetVersion 获取版本信息 OneBotV12
Expand Down
23 changes: 9 additions & 14 deletions coolq/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,23 @@ import (
"sync"
"time"

"github.com/LagrangeDev/LagrangeGo/client/sign"

"github.com/LagrangeDev/LagrangeGo/utils/binary"

"github.com/Mrs4s/go-cqhttp/internal/mime"
"golang.org/x/image/webp"

"github.com/LagrangeDev/LagrangeGo/client"
"github.com/LagrangeDev/LagrangeGo/client/entity"
event2 "github.com/LagrangeDev/LagrangeGo/client/event"
"github.com/LagrangeDev/LagrangeGo/utils"

"github.com/LagrangeDev/LagrangeGo/client"
"github.com/LagrangeDev/LagrangeGo/client/sign"
"github.com/LagrangeDev/LagrangeGo/message"
"github.com/RomiChan/syncx"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"

"github.com/LagrangeDev/LagrangeGo/utils"
"github.com/LagrangeDev/LagrangeGo/utils/binary"
"github.com/Mrs4s/go-cqhttp/db"
"github.com/Mrs4s/go-cqhttp/global"
"github.com/Mrs4s/go-cqhttp/internal/base"
"github.com/Mrs4s/go-cqhttp/internal/mime"
"github.com/Mrs4s/go-cqhttp/internal/msg"
"github.com/Mrs4s/go-cqhttp/pkg/onebot"
"github.com/RomiChan/syncx"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"golang.org/x/image/webp"
)

// CQBot CQBot结构体,存储Bot实例相关配置
Expand Down
5 changes: 1 addition & 4 deletions coolq/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@ import (
"strings"

"github.com/LagrangeDev/LagrangeGo/client/entity"

"github.com/LagrangeDev/LagrangeGo/message"

log "github.com/sirupsen/logrus"

"github.com/Mrs4s/go-cqhttp/global"
log "github.com/sirupsen/logrus"
)

func convertGroupMemberInfo(groupID int64, m *entity.GroupMember) global.MSG {
Expand Down
14 changes: 6 additions & 8 deletions coolq/cqcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,10 @@ import (
"strings"
"time"

"github.com/LagrangeDev/LagrangeGo/utils"
"github.com/LagrangeDev/LagrangeGo/utils/crypto"

"github.com/LagrangeDev/LagrangeGo/message"
"github.com/LagrangeDev/LagrangeGo/utils"
"github.com/LagrangeDev/LagrangeGo/utils/binary"
b14 "github.com/fumiama/go-base16384"
"github.com/segmentio/asm/base64"
log "github.com/sirupsen/logrus"
"github.com/tidwall/gjson"

"github.com/LagrangeDev/LagrangeGo/utils/crypto"
"github.com/Mrs4s/go-cqhttp/db"
"github.com/Mrs4s/go-cqhttp/global"
"github.com/Mrs4s/go-cqhttp/internal/base"
Expand All @@ -34,6 +28,10 @@ import (
"github.com/Mrs4s/go-cqhttp/internal/msg"
"github.com/Mrs4s/go-cqhttp/internal/param"
"github.com/Mrs4s/go-cqhttp/pkg/onebot"
b14 "github.com/fumiama/go-base16384"
"github.com/segmentio/asm/base64"
log "github.com/sirupsen/logrus"
"github.com/tidwall/gjson"
)

// TODO: move this file to internal/msg, internal/onebot
Expand Down
4 changes: 1 addition & 3 deletions coolq/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,17 @@ import (
"strconv"
"strings"

log "github.com/sirupsen/logrus"

"github.com/LagrangeDev/LagrangeGo/client"
"github.com/LagrangeDev/LagrangeGo/client/entity"
event2 "github.com/LagrangeDev/LagrangeGo/client/event"
"github.com/LagrangeDev/LagrangeGo/message"
"github.com/LagrangeDev/LagrangeGo/utils/binary"

"github.com/Mrs4s/go-cqhttp/db"
"github.com/Mrs4s/go-cqhttp/global"
"github.com/Mrs4s/go-cqhttp/internal/base"
"github.com/Mrs4s/go-cqhttp/internal/cache"
"github.com/Mrs4s/go-cqhttp/internal/download"
log "github.com/sirupsen/logrus"
)

// ToFormattedMessage 将给定[]message.IMessageElement转换为通过coolq.SetMessageFormat所定义的消息上报格式
Expand Down
7 changes: 2 additions & 5 deletions db/leveldb/leveldb.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@ package leveldb
import (
"path"

"github.com/LagrangeDev/LagrangeGo/utils/binary"

"github.com/LagrangeDev/LagrangeGo/utils"

"github.com/LagrangeDev/LagrangeGo/utils/binary"
"github.com/Mrs4s/go-cqhttp/db"
"github.com/pkg/errors"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/opt"
"gopkg.in/yaml.v3"

"github.com/Mrs4s/go-cqhttp/db"
)

type database struct {
Expand Down
3 changes: 1 addition & 2 deletions db/leveldb/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import (
"strconv"
"strings"

"github.com/pkg/errors"

"github.com/Mrs4s/go-cqhttp/global"
"github.com/pkg/errors"
)

type intReader struct {
Expand Down
3 changes: 1 addition & 2 deletions db/mongodb/mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ package mongodb
import (
"context"

"github.com/Mrs4s/go-cqhttp/db"
"github.com/pkg/errors"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
"gopkg.in/yaml.v3"

"github.com/Mrs4s/go-cqhttp/db"
)

type database struct {
Expand Down
3 changes: 1 addition & 2 deletions db/multidb.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package db

import (
"github.com/Mrs4s/go-cqhttp/internal/base"
"github.com/pkg/errors"
"gopkg.in/yaml.v3"

"github.com/Mrs4s/go-cqhttp/internal/base"
)

// backends 多数据库支持, 后端支持
Expand Down
9 changes: 3 additions & 6 deletions db/sqlite3/sqlite3.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@ import (
"sync"
"time"

"github.com/LagrangeDev/LagrangeGo/utils/binary"

"github.com/LagrangeDev/LagrangeGo/utils"

sql "github.com/FloatTech/sqlite"
"github.com/LagrangeDev/LagrangeGo/utils"
"github.com/LagrangeDev/LagrangeGo/utils/binary"
"github.com/Mrs4s/go-cqhttp/db"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"gopkg.in/yaml.v3"

"github.com/Mrs4s/go-cqhttp/db"
)

type database struct {
Expand Down
4 changes: 2 additions & 2 deletions internal/msg/element.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
package msg

import (
"github.com/LagrangeDev/LagrangeGo/utils/binary"

"strings"
"unicode/utf8"

"github.com/LagrangeDev/LagrangeGo/utils/binary"
)

// @@@ CQ码转义处理 @@@
Expand Down
3 changes: 2 additions & 1 deletion internal/msg/local.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package msg

import (
"github.com/LagrangeDev/LagrangeGo/message"
"io"

"github.com/LagrangeDev/LagrangeGo/message"
)

// Poke 拍一拍
Expand Down

0 comments on commit 192b8c8

Please sign in to comment.