From d767c34012fe88865992eb102b1f86aca9e52ea2 Mon Sep 17 00:00:00 2001 From: qimiao <303176530@qq.com> Date: Tue, 17 Aug 2021 10:21:56 +0800 Subject: [PATCH] fmt project --- server/config/oss.go | 2 +- server/utils/upload/qiniu.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/config/oss.go b/server/config/oss.go index 37957ddf..da657586 100644 --- a/server/config/oss.go +++ b/server/config/oss.go @@ -20,7 +20,7 @@ type AliyunOSS struct { AccessKeySecret string `mapstructure:"access-key-secret" json:"accessKeySecret" yaml:"access-key-secret"` BucketName string `mapstructure:"bucket-name" json:"bucketName" yaml:"bucket-name"` BucketUrl string `mapstructure:"bucket-url" json:"bucketUrl" yaml:"bucket-url"` - BasePath string `mapstructure:"base-path" json:"basePath" yaml:"base-path"` + BasePath string `mapstructure:"base-path" json:"basePath" yaml:"base-path"` } type TencentCOS struct { Bucket string `mapstructure:"bucket" json:"bucket" yaml:"bucket"` diff --git a/server/utils/upload/qiniu.go b/server/utils/upload/qiniu.go index e70ba1fb..bfe16c8c 100644 --- a/server/utils/upload/qiniu.go +++ b/server/utils/upload/qiniu.go @@ -38,7 +38,7 @@ func (*Qiniu) UploadFile(file *multipart.FileHeader) (string, string, error) { return "", "", errors.New("function file.Open() Filed, err:" + openError.Error()) } - defer f.Close() // 创建文件 defer 关闭 + defer f.Close() // 创建文件 defer 关闭 fileKey := fmt.Sprintf("%d%s", time.Now().Unix(), file.Filename) // 文件名格式 自己可以改 建议保证唯一性 putErr := formUploader.Put(context.Background(), &ret, upToken, fileKey, f, file.Size, &putExtra) if putErr != nil {