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:
authorKamil Trzciński <ayufan@ayufan.eu>2020-08-20 17:21:12 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2020-08-20 18:45:07 +0300
commitec8f8b27bca9471f67a64fec23eb1eb3b08ccde0 (patch)
tree3e843175e1ceab4c3813dacb63482f2e0f113eb9 /internal/domain
parentf56500fa8d30838e25383910cf0b120ce2be65da (diff)
Rename `serving/disk/New()` to `serving/disk/Instance()`rename-disk-new-to-instance
The `Instance()` is a correct name for this, as we do not allocate a `Disk` each time, rather return a singleton object.
Diffstat (limited to 'internal/domain')
-rw-r--r--internal/domain/domain.go2
-rw-r--r--internal/domain/domain_test.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/internal/domain/domain.go b/internal/domain/domain.go
index 7c1639a3..4fa00cd6 100644
--- a/internal/domain/domain.go
+++ b/internal/domain/domain.go
@@ -44,7 +44,7 @@ func (d *Domain) resolve(r *http.Request) *serving.Request {
// TODO improve code around default serving, when `disk` serving gets removed
// https://gitlab.com/gitlab-org/gitlab-pages/issues/353
if request == nil {
- return &serving.Request{Serving: disk.New()}
+ return &serving.Request{Serving: disk.Instance()}
}
return request
diff --git a/internal/domain/domain_test.go b/internal/domain/domain_test.go
index 26a7735c..5fa5d792 100644
--- a/internal/domain/domain_test.go
+++ b/internal/domain/domain_test.go
@@ -23,7 +23,7 @@ type stubbedResolver struct {
func (resolver *stubbedResolver) Resolve(*http.Request) (*serving.Request, error) {
return &serving.Request{
- Serving: disk.New(),
+ Serving: disk.Instance(),
LookupPath: resolver.project,
SubPath: resolver.subpath,
}, resolver.err