浏览代码

Consolidate import styles

Prefer more greppable variant with 3 groups: stdlib then external deps
(which we don't have), then internal deps
Alois Mahdal 3 天前
父节点
当前提交
c4be4ff9ef
共有 4 个文件被更改,包括 9 次插入12 次删除
  1. 1
    0
      app/builtin/builtin.go
  2. 4
    6
      app/main.go
  3. 2
    2
      app/runnable/runnable.go
  4. 2
    4
      app/tokenize/tokenize.go

+ 1
- 0
app/builtin/builtin.go 查看文件

@@ -4,6 +4,7 @@ import "fmt"
4 4
 import "os"
5 5
 import "os/exec"
6 6
 import "strings"
7
+
7 8
 import "github.com/codecrafters-io/shell-starter-go/app/core"
8 9
 
9 10
 type Builtin interface {

+ 4
- 6
app/main.go 查看文件

@@ -1,13 +1,11 @@
1 1
 package main
2 2
 
3
-import (
4
-	"bufio"
5
-	"fmt"
6
-	"os"
7
-)
3
+import "bufio"
4
+import "fmt"
5
+import "os"
8 6
 
9
-import "github.com/codecrafters-io/shell-starter-go/app/runnable"
10 7
 import "github.com/codecrafters-io/shell-starter-go/app/core"
8
+import "github.com/codecrafters-io/shell-starter-go/app/runnable"
11 9
 
12 10
 func getInput(ctx *core.Context) (string, error) {
13 11
 	fmt.Print("$ ")

+ 2
- 2
app/runnable/runnable.go 查看文件

@@ -1,11 +1,11 @@
1 1
 package runnable
2 2
 
3
-import "os/exec"
4 3
 import "fmt"
4
+import "os/exec"
5 5
 
6
+import "github.com/codecrafters-io/shell-starter-go/app/builtin"
6 7
 import "github.com/codecrafters-io/shell-starter-go/app/core"
7 8
 import "github.com/codecrafters-io/shell-starter-go/app/tokenize"
8
-import "github.com/codecrafters-io/shell-starter-go/app/builtin"
9 9
 
10 10
 type Runnable interface {
11 11
 	Run(ctx *core.Context) core.ActionResult

+ 2
- 4
app/tokenize/tokenize.go 查看文件

@@ -1,9 +1,7 @@
1 1
 package tokenize
2 2
 
3
-import (
4
-	"fmt"
5
-	"strings"
6
-)
3
+import "fmt"
4
+import "strings"
7 5
 
8 6
 type reader struct {
9 7
 	data string