Fix lint errors in modified code (#1952)

* pkg:makelint-#779

Signed-off-by: longyuqing112 <105913803+longyuqing112@users.noreply.github.com>

* Update msg_utils.go

* Update msg_utils.go

* Update msg_utils.go

* Update msg_utils.go

* Update msg_utils.go

* Update msg_utils.go

* Update minio.go

---------

Signed-off-by: longyuqing112 <105913803+longyuqing112@users.noreply.github.com>
Co-authored-by: Xinwei Xiong <3293172751NSS@gmail.com>
This commit is contained in:
longyuqing112
2024-02-26 10:55:36 +08:00
committed by GitHub
parent ae6d21e4ea
commit c8eed84711
9 changed files with 50 additions and 42 deletions
+1 -1
View File
@@ -106,7 +106,7 @@ func (c *Controller) InitiateUpload(ctx context.Context, hash string, size int64
partNumber++
}
if maxParts > 0 && partNumber > 0 && partNumber < maxParts {
return nil, errors.New(fmt.Sprintf("too many parts: %d", partNumber))
return nil, fmt.Errorf("too many parts: %d", partNumber)
}
if info, err := c.StatObject(ctx, c.HashPath(hash)); err == nil {
return nil, &HashAlreadyExistsError{Object: info}
+2 -2
View File
@@ -52,8 +52,8 @@ const (
const successCode = http.StatusOK
const (
videoSnapshotImagePng = "png"
videoSnapshotImageJpg = "jpg"
// videoSnapshotImagePng = "png"
// videoSnapshotImageJpg = "jpg"
)
func NewCos() (s3.Interface, error) {
+1 -1
View File
@@ -140,7 +140,7 @@ func (m *Minio) initMinio(ctx context.Context) error {
return fmt.Errorf("check bucket exists error: %w", err)
}
if !exists {
if err := m.core.Client.MakeBucket(ctx, conf.Bucket, minio.MakeBucketOptions{}); err != nil {
if err = m.core.Client.MakeBucket(ctx, conf.Bucket, minio.MakeBucketOptions{}); err != nil {
return fmt.Errorf("make bucket error: %w", err)
}
}