summaryrefslogtreecommitdiffstats
path: root/modules/storage
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2022-01-20 18:46:10 +0100
committerGitHub <noreply@github.com>2022-01-20 18:46:10 +0100
commit54e9ee37a7a301dbe74d46fd3c87712e6120e9bf (patch)
tree1be12fb072625c1b896b9d72f7912b018aad502b /modules/storage
parent1d98d205f5825f40110e6628b61a97c91ac7f72d (diff)
downloadgitea-54e9ee37a7a301dbe74d46fd3c87712e6120e9bf.tar.gz
gitea-54e9ee37a7a301dbe74d46fd3c87712e6120e9bf.zip
format with gofumpt (#18184)
* gofumpt -w -l . * gofumpt -w -l -extra . * Add linter * manual fix * change make fmt
Diffstat (limited to 'modules/storage')
-rw-r--r--modules/storage/local.go4
-rw-r--r--modules/storage/minio.go4
-rw-r--r--modules/storage/storage.go6
3 files changed, 5 insertions, 9 deletions
diff --git a/modules/storage/local.go b/modules/storage/local.go
index 54e0d0563d..022e6186d4 100644
--- a/modules/storage/local.go
+++ b/modules/storage/local.go
@@ -15,9 +15,7 @@ import (
"code.gitea.io/gitea/modules/util"
)
-var (
- _ ObjectStorage = &LocalStorage{}
-)
+var _ ObjectStorage = &LocalStorage{}
// LocalStorageType is the type descriptor for local storage
const LocalStorageType Type = "local"
diff --git a/modules/storage/minio.go b/modules/storage/minio.go
index f78ba6aa27..f35f4092a9 100644
--- a/modules/storage/minio.go
+++ b/modules/storage/minio.go
@@ -122,7 +122,7 @@ func (m *MinioStorage) buildMinioPath(p string) string {
// Open open a file
func (m *MinioStorage) Open(path string) (Object, error) {
- var opts = minio.GetObjectOptions{}
+ opts := minio.GetObjectOptions{}
object, err := m.client.GetObject(m.ctx, m.bucket, m.buildMinioPath(path), opts)
if err != nil {
return nil, convertMinioErr(err)
@@ -206,7 +206,7 @@ func (m *MinioStorage) URL(path, name string) (*url.URL, error) {
// IterateObjects iterates across the objects in the miniostorage
func (m *MinioStorage) IterateObjects(fn func(path string, obj Object) error) error {
- var opts = minio.GetObjectOptions{}
+ opts := minio.GetObjectOptions{}
lobjectCtx, cancel := context.WithCancel(m.ctx)
defer cancel()
for mObjInfo := range m.client.ListObjects(lobjectCtx, m.bucket, minio.ListObjectsOptions{
diff --git a/modules/storage/storage.go b/modules/storage/storage.go
index 2532ceb35d..f11e1ac743 100644
--- a/modules/storage/storage.go
+++ b/modules/storage/storage.go
@@ -16,10 +16,8 @@ import (
"code.gitea.io/gitea/modules/setting"
)
-var (
- // ErrURLNotSupported represents url is not supported
- ErrURLNotSupported = errors.New("url method not supported")
-)
+// ErrURLNotSupported represents url is not supported
+var ErrURLNotSupported = errors.New("url method not supported")
// ErrInvalidConfiguration is called when there is invalid configuration for a storage
type ErrInvalidConfiguration struct {