From d618cf033298a0f79f67b7d7ebc0ff25fd24a40f Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Fri, 3 Jan 2025 17:48:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E5=8F=8A=E6=9B=B4=E6=96=B0=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E5=A2=9E=E5=88=A0=E6=94=B9?= =?UTF-8?q?=E6=9F=A5=E6=8E=A5=E5=8F=A3=EF=BC=8C=E6=B7=BB=E5=8A=A0=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=8A=9F=E8=83=BD.=E6=B7=BB=E5=8A=A0=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6=E6=B7=BB=E5=8A=A0=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/fileService.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/fileService.go b/service/fileService.go index 8ed6f40..9035c42 100644 --- a/service/fileService.go +++ b/service/fileService.go @@ -95,8 +95,8 @@ func CreateConfigFile(req *proto.AddConfigFileReq, userId int) error { err = fmt.Errorf("file path is invalid") return err } - _, err = os.Stat(file) - if err != nil { + _, fileErr := os.Stat(file) + if fileErr != nil { //创建文件 f, err2 := os.Create(file) if err2 != nil {