fix: missing returns

This commit is contained in:
Benedikt Kulmann committed 2026-06-11 09:28:37 +02:00
1 parent 0013836384
commit 35766b37d7
5 files changed
+9 -8

No files matched your search

+5 -6
View File
@@ -159,7 +159,7 @@ func Server(cfg *config.Config) *cobra.Command {
return err
}
service, err := font.NewService(
fontService, err = font.NewService(
font.ServiceOptions{}.
WithFontFS(fontFS).
WithRootURI(fontServiceRootURI).
@@ -170,8 +170,6 @@ func Server(cfg *config.Config) *cobra.Command {
if err != nil {
return err
}
fontService = service
}
var notificationService notification.Service
@@ -181,15 +179,16 @@ func Server(cfg *config.Config) *cobra.Command {
if err != nil {
return err
}
service, err := notification.NewService(
notificationService, err = notification.NewService(
notification.ServiceOptions{}.
WithLogger(logger).
WithGatewaySelector(gatewaySelector).
WithEventPublisher(natsStream).
WithMachineAuthAPIKey(cfg.MachineAuthAPIKey),
)
notificationService = service
if err != nil {
return err
}
}
// start HTTP server
@@ -89,6 +89,7 @@ func (s Service) DeleteFont(w http.ResponseWriter, r *http.Request) {
gatewayClient, err := s.gatewaySelector.Next()
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
_, canManage, err := collaboration.CheckPermissions(gatewayClient, r.Context(), collaboration.PermissionCollaborationManageFonts)
@@ -282,6 +283,7 @@ func (s Service) UploadFont(w http.ResponseWriter, r *http.Request) {
gatewayClient, err := s.gatewaySelector.Next()
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
_, canManage, err := collaboration.CheckPermissions(gatewayClient, r.Context(), collaboration.PermissionCollaborationManageFonts)
@@ -72,6 +72,7 @@ func (s Service) HandleNotification(w http.ResponseWriter, r *http.Request) {
gatewayClient, err := s.gatewaySelector.Next()
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
requestUser, canManage, err := collaboration.CheckPermissions(gatewayClient, r.Context(), collaboration.PermissionCollaborationPublishNotification)
@@ -19,7 +19,6 @@ func (s eventsNotifier) handleResourceMention(e ocEvents.ResourceMention, eventI
Str("event", "Mention").
Str("resourceid", e.Ref.GetResourceId().GetOpaqueId()).
Logger()
_ = logger
gatewayClient, err := s.gatewaySelector.Next()
if err != nil {
return
@@ -86,7 +86,7 @@ func CollaborationManageFontsPermission(c settingsmsg.Permission_Constraint) *se
}
}
// CollaborationPublishNotificationPermission is the permission to manage fonts
// CollaborationPublishNotificationPermission is the permission to publish collaboration notifications
func CollaborationPublishNotificationPermission(c settingsmsg.Permission_Constraint) *settingsmsg.Setting {
return &settingsmsg.Setting{
Id: "43e5948e-8238-41d6-9ef1-f259f00591db",