Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfeistel <6742251-feistel@users.noreply.gitlab.com>2021-12-14 03:06:54 +0300
committerfeistel <6742251-feistel@users.noreply.gitlab.com>2021-12-14 03:06:54 +0300
commite3f274f1b8eb69fcc57a89b89197560903fe1144 (patch)
treed9a3b216fdf9f12c4040d13aa8b9f9933c98be40 /internal/vfs
parent34f17987b6c443c01f53b8bf7f1d466bf56bbd5e (diff)
refactor: promote missingcachekey error to a static error
Diffstat (limited to 'internal/vfs')
-rw-r--r--internal/vfs/zip/vfs.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/vfs/zip/vfs.go b/internal/vfs/zip/vfs.go
index b1fdfda0..b0dbdb94 100644
--- a/internal/vfs/zip/vfs.go
+++ b/internal/vfs/zip/vfs.go
@@ -3,7 +3,6 @@ package zip
import (
"context"
"errors"
- "fmt"
"io/fs"
"net/http"
"sync"
@@ -33,7 +32,8 @@ const (
)
var (
- errAlreadyCached = errors.New("archive already cached")
+ errAlreadyCached = errors.New("archive already cached")
+ errMissingCacheKey = errors.New("missing cache key")
)
type lruCache interface {
@@ -153,7 +153,7 @@ func (zfs *zipVFS) resetCache() {
// if the context is canceled.
func (zfs *zipVFS) Root(ctx context.Context, path string, cacheKey string) (vfs.Root, error) {
if cacheKey == "" {
- return nil, fmt.Errorf("missing cacheKey")
+ return nil, errMissingCacheKey
}
// we do it in loop to not use any additional locks