Skip to content

Commit

Permalink
*.: keep import called lib consistent with radon #120
Browse files Browse the repository at this point in the history
[summary]
import lib order like:
import (
	"system lib1"
	"system lib2"
	...

	"github.com/....1"
	"github.com/....2"
	...
)

[test case]
N/A

[patch codecov]
N/A
  • Loading branch information
hustjieke committed Jun 22, 2021
1 parent bfa9c07 commit 3336385
Show file tree
Hide file tree
Showing 61 changed files with 138 additions and 76 deletions.
7 changes: 4 additions & 3 deletions src/cli/callx/callx.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ package callx

import (
"bytes"
"config"
"fmt"
"io/ioutil"
"model"
"os"
"raft"
"strconv"
"strings"
"text/tabwriter"
"time"

"config"
"model"
"raft"
"xbase/xlog"
"xbase/xrpc"

Expand Down
3 changes: 2 additions & 1 deletion src/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
package main

import (
"cli/cmd"
"fmt"
"os"

"cli/cmd"

"github.com/spf13/cobra"
)

Expand Down
7 changes: 4 additions & 3 deletions src/cli/cmd/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@ package cmd

import (
"bufio"
"cli/callx"
"encoding/json"
"fmt"
"model"
"net"
"os"
"path"
"path/filepath"
"raft"
"regexp"
"sort"
"strings"

"cli/callx"
"model"
"raft"
"xbase/common"

"github.com/spf13/cobra"
Expand Down
3 changes: 2 additions & 1 deletion src/cli/cmd/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ package cmd

import (
"fmt"
"testing"

"raft"
"server"
"testing"
"xbase/common"
"xbase/xlog"

Expand Down
5 changes: 3 additions & 2 deletions src/cli/cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ package cmd

import (
"bytes"
"config"
"fmt"
"io/ioutil"
"model"
"os"
"path/filepath"
"runtime"
"strings"

"config"
"model"
"xbase/xlog"

"github.com/spf13/cobra"
Expand Down
1 change: 1 addition & 0 deletions src/cli/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ package cmd
import (
"fmt"
"strings"

"xbase/common"

"github.com/spf13/cobra"
Expand Down
3 changes: 2 additions & 1 deletion src/cli/cmd/mock.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package cmd

import (
"config"
"os"

"config"
)

var defaultConfig = config.Config{
Expand Down
5 changes: 3 additions & 2 deletions src/cli/cmd/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
package cmd

import (
"cli/callx"
"encoding/json"
"fmt"
"model"
"path"
"strconv"
"strings"
"time"

"cli/callx"
"model"
"xbase/common"

"github.com/spf13/cobra"
Expand Down
3 changes: 2 additions & 1 deletion src/cli/cmd/mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
package cmd

import (
"testing"

"mysql"
"raft"
"server"
"testing"
"xbase/common"
"xbase/xlog"

Expand Down
1 change: 1 addition & 0 deletions src/cli/cmd/perf.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ package cmd
import (
"encoding/json"
"fmt"

"xbase/common"
"xbase/xlog"

Expand Down
3 changes: 2 additions & 1 deletion src/cli/cmd/raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
package cmd

import (
"cli/callx"
"encoding/json"
"fmt"
"strings"

"cli/callx"

"github.com/spf13/cobra"
)

Expand Down
5 changes: 3 additions & 2 deletions src/cli/cmd/raft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ package cmd
import (
"errors"
"fmt"
"raft"
"server"
"testing"
"time"

"raft"
"server"
"xbase/common"
"xbase/xlog"

Expand Down
3 changes: 2 additions & 1 deletion src/cli/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
package cmd

import (
"build"
"fmt"

"build"

"github.com/spf13/cobra"
)

Expand Down
4 changes: 3 additions & 1 deletion src/cli/cmd/xenon.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
package cmd

import (
"cli/callx"
"fmt"

"cli/callx"

"github.com/spf13/cobra"
)

Expand Down
3 changes: 2 additions & 1 deletion src/cli/cmd/xenon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
package cmd

import (
"server"
"testing"

"server"
"xbase/common"
"xbase/xlog"

Expand Down
3 changes: 2 additions & 1 deletion src/mysql/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ package mysql
import (
"database/sql"
"fmt"
"model"
"strconv"
"strings"
"time"

"model"

"github.com/pkg/errors"
)

Expand Down
5 changes: 3 additions & 2 deletions src/mysql/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
package mysql

import (
"config"
"fmt"
"model"
"testing"

"config"
"model"
"xbase/xlog"

_ "github.com/go-sql-driver/mysql"
Expand Down
1 change: 1 addition & 0 deletions src/mysql/attr.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ package mysql

import (
"fmt"

"model"
)

Expand Down
3 changes: 2 additions & 1 deletion src/mysql/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ package mysql

import (
"database/sql"
"github.com/pkg/errors"

"xbase/common"

// driver.
_ "github.com/go-sql-driver/mysql"
"github.com/pkg/errors"
)

// Query executes a query that returns rows
Expand Down
5 changes: 3 additions & 2 deletions src/mysql/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
package mysql

import (
"config"
"database/sql"
"fmt"
"model"
"testing"

"config"
"model"
"xbase/xlog"
"xbase/xrpc"

Expand Down
5 changes: 3 additions & 2 deletions src/mysql/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
package mysql

import (
"config"
"database/sql"
"fmt"
"model"
"sync"
"time"

"config"
"model"
"xbase/common"
"xbase/xlog"
)
Expand Down
1 change: 1 addition & 0 deletions src/mysql/mysql_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ package mysql

import (
"database/sql"

"model"
)

Expand Down
5 changes: 3 additions & 2 deletions src/mysql/mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
package mysql

import (
"config"
"model"
"testing"
"time"

"config"
"model"
"xbase/common"
"xbase/xlog"

Expand Down
3 changes: 2 additions & 1 deletion src/mysql/mysqlbase.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ package mysql
import (
"database/sql"
"fmt"
"model"
"strconv"
"strings"

"model"

"github.com/pkg/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion src/mysql/mysqlbase_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ package mysql

import (
"fmt"
"model"
"testing"

"config"
"model"
"xbase/xlog"

_ "github.com/go-sql-driver/mysql"
Expand Down
3 changes: 2 additions & 1 deletion src/mysql/rpc_mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
package mysql

import (
"model"
"testing"

"model"
"xbase/common"
"xbase/xlog"

Expand Down
3 changes: 2 additions & 1 deletion src/mysql/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
package mysql

import (
"model"
"sync/atomic"

"model"
)

// IncMysqlDowns used to increase the mysql down counter.
Expand Down
5 changes: 3 additions & 2 deletions src/mysqld/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
package mysqld

import (
"config"
"fmt"
"model"
"strings"
"time"

"config"
"model"
"xbase/common"
"xbase/xlog"

Expand Down
3 changes: 2 additions & 1 deletion src/mysqld/backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
package mysqld

import (
"testing"

"config"
"model"
"testing"
"xbase/common"
"xbase/xlog"

Expand Down
3 changes: 2 additions & 1 deletion src/mysqld/linux_args.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
package mysqld

import (
"config"
"fmt"
"path/filepath"

"config"
)

var (
Expand Down
Loading

0 comments on commit 3336385

Please sign in to comment.