photoprism/pkg/txt/ntimes.go
Michael Mayer 713593da4e Auth: Add CLI command to create access tokens for apps #782 #808 #3943
You can now run "photoprism auth add" to create new client access tokens
that allow external applications to use the built-in REST API.

Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-05 16:31:07 +01:00

14 lines
239 B
Go

package txt
import (
"fmt"
)
// NTimes converts an integer to a string in the format "n times" or returns an empty string if n is 0.
func NTimes(n int) string {
if n < 2 {
return ""
} else {
return fmt.Sprintf("%d times", n)
}
}