style: add trailing newlines

This commit is contained in:
2026-04-23 16:46:14 +02:00
parent 07abd0535e
commit e1f44f7179
3 changed files with 6 additions and 4 deletions

View File

@@ -53,4 +53,4 @@ func GetUser(ctx context.Context) *database.User {
return nil
}
return user
}
}

View File

@@ -1,3 +1,3 @@
package context
const UserKey = "mal:user"
const UserKey = "mal:user"

View File

@@ -13,8 +13,10 @@ func IsAdmin(user *database.User) bool {
return user.Username == AdminEmail
}
func IsAdminFromContext(ctx interface{ Value(key interface{}) interface{} }) bool {
func IsAdminFromContext(ctx interface {
Value(key interface{}) interface{}
}) bool {
const userKey = "mal:user"
user, _ := ctx.Value(userKey).(*database.User)
return IsAdmin(user)
}
}