From d9c65dedf275149ace2af284968aee78305f0367 Mon Sep 17 00:00:00 2001 From: MrMelon54 Date: Sat, 29 Mar 2025 23:49:12 +0000 Subject: [PATCH] Move the httpPrefix outside function scope --- serve/serve_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/serve/serve_test.go b/serve/serve_test.go index 8a11969..1bd79cf 100644 --- a/serve/serve_test.go +++ b/serve/serve_test.go @@ -26,6 +26,9 @@ type fakeServeDB struct { branch string } +//goland:noinspection HttpUrlsUsage +const httpPrefix = "http://" + func (f *fakeServeDB) GetLastUpdatedByDomainBranch(_ context.Context, params database.GetLastUpdatedByDomainBranchParams) (time.Time, error) { if params.Domain == "example.com" && params.Branch == "@"+f.branch { return time.Now(), nil @@ -51,8 +54,6 @@ func serveTest(t *testing.T, address string, branch string, name string) { assert.NoError(t, afero.WriteFile(fs, name, []byte("Hello World\n"), 0666)) h := New(fs, &fakeServeDB{branch: branch}) - //goland:noinspection HttpUrlsUsage - const httpPrefix = "http://" req := httptest.NewRequest(http.MethodGet, httpPrefix+address, nil) if branch != "" { req.AddCookie(&http.Cookie{