photoprism/pkg/list/add.go
Michael Mayer 884dea17de Security: Use individual preview tokens for each user account #98
Signed-off-by: Michael Mayer <michael@photoprism.app>
2022-10-13 22:11:02 +02:00

14 lines
270 B
Go

package list
// Add adds a string to the list if it does not exist yet.
func Add(list []string, s string) []string {
if s == "" {
return list
} else if len(list) == 0 {
return []string{s}
} else if Contains(list, s) {
return list
}
return append(list, s)
}