feat: super 包支持使用 super.GoFormat 函数格式化 go 文件

This commit is contained in:
kercylan98 2023-07-17 17:05:21 +08:00
parent 9349e3cdbe
commit 3ee638f4df
1 changed files with 9 additions and 0 deletions

9
utils/super/gofmt.go Normal file
View File

@ -0,0 +1,9 @@
package super
import "os/exec"
// GoFormat go 代码格式化
func GoFormat(filePath string) {
cmd := exec.Command("gofmt", "-w", filePath)
_ = cmd.Run()
}