Skip to content

Commit

Permalink
fix staticcheck reported issues
Browse files Browse the repository at this point in the history
  • Loading branch information
CubicrootXYZ committed Oct 20, 2024
1 parent 647f8fa commit 8bdd716
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
16 changes: 8 additions & 8 deletions internal/api/application_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func TestApi_RegisterApplicationWithoutUser(t *testing.T) {
reqWoUser := tests.Request{Name: "Invalid JSON Data", Method: "POST", Endpoint: "/application", Data: `{"name": "test1", "strict_compatibility": true}`, Headers: map[string]string{"Content-Type": "application/json"}}
_, c, err := reqWoUser.GetRequest()
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}

assert.Panicsf(func() { TestApplicationHandler.CreateApplication(c) }, "CreateApplication did not panic although user is not in context")
Expand All @@ -115,7 +115,7 @@ func TestApi_RegisterApplication(t *testing.T) {
var application model.Application
w, c, err := req.GetRequest()
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}

c.Set("user", user)
Expand Down Expand Up @@ -150,7 +150,7 @@ func TestApi_GetApplications(t *testing.T) {
for _, req := range testCases {
w, c, err := req.GetRequest()
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}

c.Set("user", user)
Expand Down Expand Up @@ -183,7 +183,7 @@ func TestApi_GetApplicationsWithoutUser(t *testing.T) {

_, c, err := testCase.GetRequest()
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}

assert.Panicsf(func() { TestApplicationHandler.GetApplications(c) }, "GetApplications did not panic although user is not in context")
Expand All @@ -203,7 +203,7 @@ func TestApi_GetApplicationErrors(t *testing.T) {
for id, req := range testCases {
w, c, err := req.GetRequest()
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}

c.Set("user", user)
Expand All @@ -229,7 +229,7 @@ func TestApi_GetApplication(t *testing.T) {

w, c, err := req.GetRequest()
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}

c.Set("user", user)
Expand Down Expand Up @@ -282,7 +282,7 @@ func TestApi_UpdateApplication(t *testing.T) {
for id, req := range testCases {
w, c, err := req.GetRequest()
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}

c.Set("user", user)
Expand Down Expand Up @@ -310,7 +310,7 @@ func TestApi_DeleteApplication(t *testing.T) {
for id, req := range testCases {
w, c, err := req.GetRequest()
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}

c.Set("user", user)
Expand Down
6 changes: 3 additions & 3 deletions internal/api/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestApi_getID(t *testing.T) {
for id, req := range testCases {
w, c, err := req.GetRequest()
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}

c.Set("id", id)
Expand Down Expand Up @@ -74,7 +74,7 @@ func TestApi_getApplication(t *testing.T) {
for id, req := range testCases {
w, c, err := req.GetRequest()
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}

c.Set("id", id)
Expand Down Expand Up @@ -109,7 +109,7 @@ func TestApi_getUser(t *testing.T) {
for id, req := range testCases {
w, c, err := req.GetRequest()
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}

c.Set("id", id)
Expand Down
2 changes: 1 addition & 1 deletion internal/api/health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestApi_Health(t *testing.T) {
for _, req := range testCases {
w, c, err := req.GetRequest()
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}
handler.Health(c)

Expand Down
4 changes: 2 additions & 2 deletions internal/api/notification_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestApi_CreateNotification(t *testing.T) {
var notification model.Notification
w, c, err := req.GetRequest()
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}

c.Set("app", &testApplication)
Expand Down Expand Up @@ -83,7 +83,7 @@ func TestApi_DeleteNotification(t *testing.T) {
for id, req := range testCases {
w, c, err := req.GetRequest()
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}

c.Set("app", &testApplication)
Expand Down
6 changes: 3 additions & 3 deletions internal/api/user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestApi_CreateUser(t *testing.T) {
for _, req := range testCases {
w, c, err := req.GetRequest()
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}

TestUserHandler.CreateUser(c)
Expand Down Expand Up @@ -120,7 +120,7 @@ func TestApi_UpdateUser(t *testing.T) {
for id, req := range testCases {
w, c, err := req.GetRequest()
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}

c.Set("id", id)
Expand All @@ -134,7 +134,7 @@ func TestApi_UpdateUser(t *testing.T) {
for id, req := range testCases {
_, c, err := req.GetRequest()
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}

c.Set("id", id)
Expand Down

0 comments on commit 8bdd716

Please sign in to comment.