FIX: globally fix typo 'Field' to 'failed' (#1471)
This commit is contained in:
@@ -35,16 +35,16 @@ func (*Qiniu) UploadFile(file *multipart.FileHeader) (string, string, error) {
|
||||
|
||||
f, openError := file.Open()
|
||||
if openError != nil {
|
||||
global.GVA_LOG.Error("function file.Open() Filed", zap.Any("err", openError.Error()))
|
||||
global.GVA_LOG.Error("function file.Open() failed", zap.Any("err", openError.Error()))
|
||||
|
||||
return "", "", errors.New("function file.Open() Filed, err:" + openError.Error())
|
||||
return "", "", errors.New("function file.Open() failed, err:" + openError.Error())
|
||||
}
|
||||
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 {
|
||||
global.GVA_LOG.Error("function formUploader.Put() Filed", zap.Any("err", putErr.Error()))
|
||||
return "", "", errors.New("function formUploader.Put() Filed, err:" + putErr.Error())
|
||||
global.GVA_LOG.Error("function formUploader.Put() failed", zap.Any("err", putErr.Error()))
|
||||
return "", "", errors.New("function formUploader.Put() failed, err:" + putErr.Error())
|
||||
}
|
||||
return global.GVA_CONFIG.Qiniu.ImgPath + "/" + ret.Key, ret.Key, nil
|
||||
}
|
||||
@@ -63,8 +63,8 @@ func (*Qiniu) DeleteFile(key string) error {
|
||||
cfg := qiniuConfig()
|
||||
bucketManager := storage.NewBucketManager(mac, cfg)
|
||||
if err := bucketManager.Delete(global.GVA_CONFIG.Qiniu.Bucket, key); err != nil {
|
||||
global.GVA_LOG.Error("function bucketManager.Delete() Filed", zap.Any("err", err.Error()))
|
||||
return errors.New("function bucketManager.Delete() Filed, err:" + err.Error())
|
||||
global.GVA_LOG.Error("function bucketManager.Delete() failed", zap.Any("err", err.Error()))
|
||||
return errors.New("function bucketManager.Delete() failed, err:" + err.Error())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user