From 56c757561f17f41b3fe2ee15770dbc36e7d3fabd Mon Sep 17 00:00:00 2001 From: Gusted Date: Fri, 31 Jan 2025 10:54:26 +0100 Subject: [PATCH] chore: Remove `ErrInvalidConfiguration` - Introduced in 6b1266b6b32c3a1c4a02c7e913a2c5fdfe0d2b4a and removed in 6f9c278559789066aa831c1df25b0d866103d02d. --- .deadcode-out | 4 ---- modules/storage/storage.go | 19 ------------------- 2 files changed, 23 deletions(-) diff --git a/.deadcode-out b/.deadcode-out index 892dd0ca9c..b370a3b02a 100644 --- a/.deadcode-out +++ b/.deadcode-out @@ -201,10 +201,6 @@ code.gitea.io/gitea/modules/setting GitConfigType.GetOption InitLoggersForTest -code.gitea.io/gitea/modules/storage - ErrInvalidConfiguration.Error - IsErrInvalidConfiguration - code.gitea.io/gitea/modules/structs ParseCreateHook ParsePushHook diff --git a/modules/storage/storage.go b/modules/storage/storage.go index d944b8618f..453d755fbb 100644 --- a/modules/storage/storage.go +++ b/modules/storage/storage.go @@ -18,25 +18,6 @@ import ( // 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 { - cfg any - err error -} - -func (err ErrInvalidConfiguration) Error() string { - if err.err != nil { - return fmt.Sprintf("Invalid Configuration Argument: %v: Error: %v", err.cfg, err.err) - } - return fmt.Sprintf("Invalid Configuration Argument: %v", err.cfg) -} - -// IsErrInvalidConfiguration checks if an error is an ErrInvalidConfiguration -func IsErrInvalidConfiguration(err error) bool { - _, ok := err.(ErrInvalidConfiguration) - return ok -} - type Type = setting.StorageType // NewStorageFunc is a function that creates a storage