add goimports

goimports support.
This commit is contained in:
谢小军
2019-08-30 10:27:09 +08:00
parent a3964bc6ad
commit 3170c62d99

View File

@@ -29,6 +29,12 @@ func Execute() {
tools.WriteFile(path,
[]string{str}, true)
cmd, _ := exec.Command("gofmt", "-l", "-w", path).Output()
fmt.Println("formatting differs from goimport's:")
cmd, _ := exec.Command("goimports", "-l", "-w", path).Output()
fmt.Println(string(cmd))
fmt.Println("formatting differs from gofmt's:")
cmd, _ = exec.Command("gofmt", "-l", "-w", path).Output()
fmt.Println(string(cmd))
}