diff --git a/utils/super/gofmt.go b/utils/super/gofmt.go new file mode 100644 index 0000000..a4f2d24 --- /dev/null +++ b/utils/super/gofmt.go @@ -0,0 +1,9 @@ +package super + +import "os/exec" + +// GoFormat go 代码格式化 +func GoFormat(filePath string) { + cmd := exec.Command("gofmt", "-w", filePath) + _ = cmd.Run() +}