mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-20 10:35:01 +00:00
fix(gallery): do not attempt to delete duplicate files (#3031)
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
610e1c00c6
commit
2a839e1432
2 changed files with 27 additions and 16 deletions
|
@ -18,3 +18,15 @@ func RandString(n int) string {
|
|||
}
|
||||
return string(b)
|
||||
}
|
||||
|
||||
func Unique(arr []string) []string {
|
||||
unique := make(map[string]bool)
|
||||
var result []string
|
||||
for _, item := range arr {
|
||||
if _, ok := unique[item]; !ok {
|
||||
unique[item] = true
|
||||
result = append(result, item)
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue