feat: super 包支持使用 super.GoFormat 函数格式化 go 文件
This commit is contained in:
parent
9349e3cdbe
commit
3ee638f4df
|
@ -0,0 +1,9 @@
|
||||||
|
package super
|
||||||
|
|
||||||
|
import "os/exec"
|
||||||
|
|
||||||
|
// GoFormat go 代码格式化
|
||||||
|
func GoFormat(filePath string) {
|
||||||
|
cmd := exec.Command("gofmt", "-w", filePath)
|
||||||
|
_ = cmd.Run()
|
||||||
|
}
|
Loading…
Reference in New Issue