mirror of
https://github.com/hrfee/jfa-go.git
synced 2024-11-04 17:30:11 +00:00
email: use strconv.Itoa instead of sprintf
This commit is contained in:
parent
dbe7e2e659
commit
30f16e7207
7
email.go
7
email.go
@ -11,6 +11,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"net/smtp"
|
"net/smtp"
|
||||||
"os"
|
"os"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
textTemplate "text/template"
|
textTemplate "text/template"
|
||||||
@ -108,13 +109,13 @@ func (emailer *Emailer) formatExpiry(expiry time.Time, tzaware bool, datePattern
|
|||||||
}
|
}
|
||||||
_, _, days, hours, minutes, _ := timeDiff(expiry, currentTime)
|
_, _, days, hours, minutes, _ := timeDiff(expiry, currentTime)
|
||||||
if days != 0 {
|
if days != 0 {
|
||||||
expiresIn += fmt.Sprintf("%dd ", days)
|
expiresIn += strconv.Itoa(days) + "d "
|
||||||
}
|
}
|
||||||
if hours != 0 {
|
if hours != 0 {
|
||||||
expiresIn += fmt.Sprintf("%dh ", hours)
|
expiresIn += strconv.Itoa(hours) + "h "
|
||||||
}
|
}
|
||||||
if minutes != 0 {
|
if minutes != 0 {
|
||||||
expiresIn += fmt.Sprintf("%dm ", minutes)
|
expiresIn += strconv.Itoa(minutes) + "m "
|
||||||
}
|
}
|
||||||
expiresIn = strings.TrimSuffix(expiresIn, " ")
|
expiresIn = strings.TrimSuffix(expiresIn, " ")
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user