Move the httpPrefix outside function scope

This commit is contained in:
Melon 2025-03-29 23:49:12 +00:00
parent 3719fc57cc
commit d9c65dedf2
Signed by: melon
GPG Key ID: 6C9D970C50D26A25

View File

@ -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{