mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
add groups support
Using groups simplifies the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
11
util/util.go
11
util/util.go
@@ -71,15 +71,16 @@ func RemoveDuplicates(obj []string) []string {
|
||||
if len(obj) == 0 {
|
||||
return obj
|
||||
}
|
||||
result := make([]string, 0, len(obj))
|
||||
seen := make(map[string]bool)
|
||||
validIdx := 0
|
||||
for _, item := range obj {
|
||||
if _, ok := seen[item]; !ok {
|
||||
result = append(result, item)
|
||||
if !seen[item] {
|
||||
seen[item] = true
|
||||
obj[validIdx] = item
|
||||
validIdx++
|
||||
}
|
||||
seen[item] = true
|
||||
}
|
||||
return result
|
||||
return obj[:validIdx]
|
||||
}
|
||||
|
||||
// GetTimeAsMsSinceEpoch returns unix timestamp as milliseconds from a time struct
|
||||
|
||||
Reference in New Issue
Block a user