refactoring of code

This commit is contained in:
Jonas Kaninda
2024-11-15 15:42:02 +01:00
parent 5a6c30ec95
commit a5823890a8
5 changed files with 19 additions and 14 deletions

View File

@@ -39,8 +39,9 @@ func TestStart(t *testing.T) {
if err != nil {
t.Fatalf("Error initializing config: %s", err.Error())
}
ctx := context.Background()
g := GatewayServer{}
gatewayServer, err := g.Config(configFile)
gatewayServer, err := g.Config(configFile, ctx)
if err != nil {
t.Error(err)
}
@@ -54,9 +55,8 @@ func TestStart(t *testing.T) {
t.Fatalf("expected a status code of 200, got %v", resp.StatusCode)
}
}
ctx := context.Background()
go func() {
err = gatewayServer.Start(ctx)
err = gatewayServer.Start()
if err != nil {
t.Error(err)
return