diff --git a/internal/api/application.go b/internal/api/application.go index dc117ee..435909f 100644 --- a/internal/api/application.go +++ b/internal/api/application.go @@ -121,7 +121,7 @@ func (h *ApplicationHandler) updateApplication(ctx *gin.Context, a *model.Applic // @Accept json,mpfd // @Produce json // @Param name query string true "Name of the application" -// @Param strict_compatability query boolean false "Use strict compatability mode" +// @Param strict_compatibility query boolean false "Use strict compatibility mode" // @Success 200 {object} model.Application // @Failure 400 "" // @Security BasicAuth @@ -243,7 +243,7 @@ func (h *ApplicationHandler) DeleteApplication(ctx *gin.Context) { // @Param id path int true "ID of the application" // @Param name query string false "New name for the application" // @Param refresh_token query bool false "Generate new refresh token for the application" -// @Param strict_compatability query bool false "Whether to use strict compataibility mode" +// @Param strict_compatibility query bool false "Whether to use strict compataibility mode" // @Success 200 "" // @Failure 500,404,403 "" // @Security BasicAuth diff --git a/internal/api/application_test.go b/internal/api/application_test.go index ca4f003..58376c3 100644 --- a/internal/api/application_test.go +++ b/internal/api/application_test.go @@ -96,7 +96,7 @@ func TestApi_RegisterApplicationWithoutUser(t *testing.T) { t.Fatalf(err.Error()) } - assert.Panicsf(func() { TestApplicationHandler.CreateApplication(c) }, "CreateApplication did not panic altough user is not in context") + assert.Panicsf(func() { TestApplicationHandler.CreateApplication(c) }, "CreateApplication did not panic although user is not in context") } func TestApi_RegisterApplication(t *testing.T) { @@ -186,7 +186,7 @@ func TestApi_GetApplicationsWithoutUser(t *testing.T) { t.Fatalf(err.Error()) } - assert.Panicsf(func() { TestApplicationHandler.GetApplications(c) }, "GetApplications did not panic altough user is not in context") + assert.Panicsf(func() { TestApplicationHandler.GetApplications(c) }, "GetApplications did not panic although user is not in context") } func TestApi_GetApplicationErrors(t *testing.T) { diff --git a/internal/api/context.go b/internal/api/context.go index 43a6271..34fe836 100644 --- a/internal/api/context.go +++ b/internal/api/context.go @@ -12,7 +12,7 @@ import ( func getID(ctx *gin.Context) (uint, error) { id, ok := ctx.MustGet("id").(uint) if !ok { - err := errors.New("an error occured while retrieving ID from context") + err := errors.New("an error occurred while retrieving ID from context") ctx.AbortWithError(http.StatusInternalServerError, err) return 0, err } @@ -23,7 +23,7 @@ func getID(ctx *gin.Context) (uint, error) { func getMessageID(ctx *gin.Context) (string, error) { id, ok := ctx.MustGet("messageid").(string) if !ok { - err := errors.New("an error occured while retrieving messageID from context") + err := errors.New("an error occurred while retrieving messageID from context") ctx.AbortWithError(http.StatusInternalServerError, err) return "", err } diff --git a/internal/api/context_test.go b/internal/api/context_test.go index 254d019..d93b941 100644 --- a/internal/api/context_test.go +++ b/internal/api/context_test.go @@ -39,14 +39,14 @@ func TestApi_getID(t *testing.T) { idReturned, err := getID(c) if req.ShouldStatus >= 200 && req.ShouldStatus < 300 { - require.NoErrorf(err, "getId with id %v (%t) returned an error altough it should not: %v", id, id, err) + require.NoErrorf(err, "getId with id %v (%t) returned an error although it should not: %v", id, id, err) idUint, ok := id.(uint) if ok { assert.Equalf(idReturned, idUint, "getApi id was set to %d but result is %d", idUint, idReturned) } } else { - assert.Errorf(err, "getId with id %v (%t) returned no error altough it should", id, id) + assert.Errorf(err, "getId with id %v (%t) returned no error although it should", id, id) } assert.Equalf(w.Code, req.ShouldStatus, "getApi id was set to %v (%T) and should result in status code %d but code is %d", id, id, req.ShouldStatus, w.Code) @@ -81,10 +81,10 @@ func TestApi_getApplication(t *testing.T) { app, err := getApplication(c, TestDatabase) if req.ShouldStatus >= 200 && req.ShouldStatus < 300 { - require.NoErrorf(err, "getApplication with id %v (%t) returned an error altough it should not: %v", id, id, err) + require.NoErrorf(err, "getApplication with id %v (%t) returned an error although it should not: %v", id, id, err) assert.Equalf(app.ID, id, "getApplication id was set to %d but resulting app id is %d", id, app.ID) } else { - assert.Errorf(err, "getApplication with id %v (%t) returned no error altough it should", id, id) + assert.Errorf(err, "getApplication with id %v (%t) returned no error although it should", id, id) } assert.Equalf(w.Code, req.ShouldStatus, "getApplication id was set to %v (%T) and should result in status code %d but code is %d", id, id, req.ShouldStatus, w.Code) @@ -116,11 +116,11 @@ func TestApi_getUser(t *testing.T) { user, err := getUser(c, TestDatabase) if req.ShouldStatus >= 200 && req.ShouldStatus < 300 { - require.NoErrorf(err, "getUser with id %v (%t) returned an error altough it should not: %v", id, id, err) + require.NoErrorf(err, "getUser with id %v (%t) returned an error although it should not: %v", id, id, err) assert.Equalf(user.ID, id, "getUser id was set to %d but resulting app id is %d", id, user.ID) } else { - assert.Errorf(err, "getUser with id %v (%t) returned no error altough it should", id, id) + assert.Errorf(err, "getUser with id %v (%t) returned no error although it should", id, id) } assert.Equalf(w.Code, req.ShouldStatus, "getUser id was set to %v (%T) and should result in status code %d but code is %d", id, id, req.ShouldStatus, w.Code) diff --git a/internal/authentication/context.go b/internal/authentication/context.go index 5326646..eb9cca9 100644 --- a/internal/authentication/context.go +++ b/internal/authentication/context.go @@ -13,7 +13,7 @@ import ( func GetApplication(ctx *gin.Context) *model.Application { app, ok := ctx.MustGet("app").(*model.Application) if app == nil || !ok { - ctx.AbortWithError(http.StatusInternalServerError, errors.New("an error occured while retrieving application from context")) + ctx.AbortWithError(http.StatusInternalServerError, errors.New("an error occurred while retrieving application from context")) return nil } @@ -24,7 +24,7 @@ func GetApplication(ctx *gin.Context) *model.Application { func GetUser(ctx *gin.Context) *model.User { user, ok := ctx.MustGet("user").(*model.User) if user == nil || !ok { - ctx.AbortWithError(http.StatusInternalServerError, errors.New("an error occured while retrieving user from context")) + ctx.AbortWithError(http.StatusInternalServerError, errors.New("an error occurred while retrieving user from context")) return nil } diff --git a/internal/configuration/configuration_test.go b/internal/configuration/configuration_test.go index 361b1f6..1e2339c 100644 --- a/internal/configuration/configuration_test.go +++ b/internal/configuration/configuration_test.go @@ -62,7 +62,7 @@ func TestConfiguration_GetEmpty(t *testing.T) { os.Exit(1) } - assert.Panicsf(t, func() { Get() }, "Get() did not panic altough config is empty") + assert.Panicsf(t, func() { Get() }, "Get() did not panic although config is empty") } func TestConfiguration_GetInvalid(t *testing.T) { @@ -72,7 +72,7 @@ func TestConfiguration_GetInvalid(t *testing.T) { os.Exit(1) } - assert.Panicsf(t, func() { Get() }, "Get() did not panic altough config is empty") + assert.Panicsf(t, func() { Get() }, "Get() did not panic although config is empty") } func TestConfiguaration_ConfigFiles(t *testing.T) {