From 3ee638f4df459f36a05190b3874502f68e815fd2 Mon Sep 17 00:00:00 2001 From: kercylan98 Date: Mon, 17 Jul 2023 17:05:21 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20super=20=E5=8C=85=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=20super.GoFormat=20=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=20go=20=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/super/gofmt.go | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 utils/super/gofmt.go 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() +}