make linter happy

Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
Christian Richter
2023-06-19 07:54:55 +02:00
parent a3b8a7742a
commit a8934c3655
2 changed files with 18 additions and 17 deletions
+2 -1
View File
@@ -2,7 +2,8 @@ package types
import "strings"
func SplitId(id string) (string, string) {
// SplitStorageIDFromSpaceID splits the storage- and spaceid- from the given string
func SplitStorageIDFromSpaceID(id string) (string, string) {
ids := strings.Split(id, "$")
if len(ids) != 2 {
return id, ""
+16 -16
View File
@@ -139,51 +139,51 @@ func MessageFileVersionRestored(executant, item, version string) string {
// MessageSpaceCreated returns the human readable string that describes the action
func MessageSpaceCreated(executant, spaceID, name string) string {
storagId, spaceID := SplitId(spaceID)
return fmt.Sprintf("user '%s' created a space '%s' with name '%s' (storage: '%s')", executant, spaceID, name, storagId)
storagID, spaceID := SplitStorageIDFromSpaceID(spaceID)
return fmt.Sprintf("user '%s' created a space '%s' with name '%s' (storage: '%s')", executant, spaceID, name, storagID)
}
// MessageSpaceRenamed returns the human readable string that describes the action
func MessageSpaceRenamed(executant, spaceID, name string) string {
storagId, spaceID := SplitId(spaceID)
return fmt.Sprintf("user '%s' renamed space '%s' to '%s' (storage: '%s')", executant, spaceID, name, storagId)
storagID, spaceID := SplitStorageIDFromSpaceID(spaceID)
return fmt.Sprintf("user '%s' renamed space '%s' to '%s' (storage: '%s')", executant, spaceID, name, storagID)
}
// MessageSpaceDisabled returns the human readable string that describes the action
func MessageSpaceDisabled(executant, spaceID string) string {
storagId, spaceID := SplitId(spaceID)
return fmt.Sprintf("user '%s' disabled the space '%s' (storage: '%s')", executant, spaceID, storagId)
storagID, spaceID := SplitStorageIDFromSpaceID(spaceID)
return fmt.Sprintf("user '%s' disabled the space '%s' (storage: '%s')", executant, spaceID, storagID)
}
// MessageSpaceEnabled returns the human readable string that describes the action
func MessageSpaceEnabled(executant, spaceID string) string {
storagId, spaceID := SplitId(spaceID)
return fmt.Sprintf("user '%s' (re-) enabled the space '%s' (storage: '%s')", executant, spaceID, storagId)
storagID, spaceID := SplitStorageIDFromSpaceID(spaceID)
return fmt.Sprintf("user '%s' (re-) enabled the space '%s' (storage: '%s')", executant, spaceID, storagID)
}
// MessageSpaceDeleted returns the human readable string that describes the action
func MessageSpaceDeleted(executant, spaceID string) string {
storagId, spaceID := SplitId(spaceID)
return fmt.Sprintf("user '%s' deleted the space '%s' (storage: '%s')", executant, spaceID, storagId)
storagID, spaceID := SplitStorageIDFromSpaceID(spaceID)
return fmt.Sprintf("user '%s' deleted the space '%s' (storage: '%s')", executant, spaceID, storagID)
}
// MessageSpaceShared returns the human readable string that describes the action
func MessageSpaceShared(executant, spaceID, grantee string) string {
storagId, spaceID := SplitId(spaceID)
return fmt.Sprintf("user '%s' shared the space '%s' with '%s' (storage: '%s')", executant, spaceID, grantee, storagId)
storagID, spaceID := SplitStorageIDFromSpaceID(spaceID)
return fmt.Sprintf("user '%s' shared the space '%s' with '%s' (storage: '%s')", executant, spaceID, grantee, storagID)
}
// MessageSpaceUnshared returns the human readable string that describes the action
func MessageSpaceUnshared(executant, spaceID, grantee string) string {
storagId, spaceID := SplitId(spaceID)
return fmt.Sprintf("user '%s' unshared the space '%s' with '%s' (storage: '%s')", executant, spaceID, grantee, storagId)
storagID, spaceID := SplitStorageIDFromSpaceID(spaceID)
return fmt.Sprintf("user '%s' unshared the space '%s' with '%s' (storage: '%s')", executant, spaceID, grantee, storagID)
}
// MessageSpaceUpdated returns the human readable string that describes the action
func MessageSpaceUpdated(executant, spaceID, name string, quota uint64, opaque map[string]string) string {
storagId, spaceID := SplitId(spaceID)
storagID, spaceID := SplitStorageIDFromSpaceID(spaceID)
return fmt.Sprintf("user '%s' updated space '%s'. name: '%s', quota: '%d', opaque: '%s' (storage: '%s')",
executant, spaceID, name, quota, opaque, storagId)
executant, spaceID, name, quota, opaque, storagID)
}
// MessageUserCreated returns the human readable string that describes the action