mirror of
https://github.com/axllent/mailpit.git
synced 2025-06-06 23:36:23 +02:00
12 lines
272 B
Go
12 lines
272 B
Go
package tools
|
|
|
|
import "fmt"
|
|
|
|
// Plural returns a singular or plural of a word together with the total
|
|
func Plural(total int, singular, plural string) string {
|
|
if total == 1 {
|
|
return fmt.Sprintf("%d %s", total, singular)
|
|
}
|
|
return fmt.Sprintf("%d %s", total, plural)
|
|
}
|