From ec8f8b27bca9471f67a64fec23eb1eb3b08ccde0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Thu, 20 Aug 2020 16:21:12 +0200 Subject: Rename `serving/disk/New()` to `serving/disk/Instance()` The `Instance()` is a correct name for this, as we do not allocate a `Disk` each time, rather return a singleton object. --- internal/domain/domain.go | 2 +- internal/domain/domain_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/domain') 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 -- cgit v1.2.3