feat(deps): update golangci-lint to v2
This commit was merged in pull request #55.
This commit is contained in:
26
main_test.go
26
main_test.go
@@ -1634,7 +1634,10 @@ func setupIntegrationTest(t *testing.T) (db *sqlx.DB, basePath string, ctx conte
|
||||
t.Fatalf("Could not open Database data.db: %v", err)
|
||||
}
|
||||
t.Cleanup(func() {
|
||||
db.Close()
|
||||
err := db.Close()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
})
|
||||
|
||||
testPort := port.Add(1)
|
||||
@@ -1652,17 +1655,18 @@ func setupIntegrationTest(t *testing.T) (db *sqlx.DB, basePath string, ctx conte
|
||||
|
||||
func getEnv(port int32) func(string) string {
|
||||
return func(key string) string {
|
||||
if key == "PORT" {
|
||||
switch key {
|
||||
case "PORT":
|
||||
return fmt.Sprint(port)
|
||||
} else if key == "SMTP_ENABLED" {
|
||||
case "SMTP_ENABLED":
|
||||
return "false"
|
||||
} else if key == "PROMETHEUS_ENABLED" {
|
||||
case "PROMETHEUS_ENABLED":
|
||||
return "false"
|
||||
} else if key == "BASE_URL" {
|
||||
case "BASE_URL":
|
||||
return "http://localhost:" + fmt.Sprint(port)
|
||||
} else if key == "ENVIRONMENT" {
|
||||
case "ENVIRONMENT":
|
||||
return "test"
|
||||
} else {
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
}
|
||||
@@ -1685,10 +1689,12 @@ func waitForReady(
|
||||
|
||||
resp, err := client.Do(req)
|
||||
if err == nil && resp.StatusCode == http.StatusOK {
|
||||
resp.Body.Close()
|
||||
return nil
|
||||
return resp.Body.Close()
|
||||
} else if err == nil {
|
||||
resp.Body.Close()
|
||||
err := resp.Body.Close()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
select {
|
||||
|
||||
Reference in New Issue
Block a user