mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 17:47:03 +00:00
chore: two small lint fixes (#506)
* chore: faster hash to string conv Signed-off-by: James Hillyerd <james@hillyerd.com> * chore: require NoError in integration test setup Signed-off-by: James Hillyerd <james@hillyerd.com> --------- Signed-off-by: James Hillyerd <james@hillyerd.com>
This commit is contained in:
@@ -2,7 +2,7 @@ package stringutil
|
||||
|
||||
import (
|
||||
"crypto/sha1"
|
||||
"fmt"
|
||||
"encoding/hex"
|
||||
"io"
|
||||
"net/mail"
|
||||
"strings"
|
||||
@@ -13,10 +13,11 @@ import (
|
||||
func HashMailboxName(mailbox string) string {
|
||||
h := sha1.New()
|
||||
if _, err := io.WriteString(h, mailbox); err != nil {
|
||||
// This shouldn't ever happen
|
||||
// This should never happen.
|
||||
return ""
|
||||
}
|
||||
return fmt.Sprintf("%x", h.Sum(nil))
|
||||
|
||||
return hex.EncodeToString(h.Sum(nil))
|
||||
}
|
||||
|
||||
// StringAddress converts an Address to a UTF-8 string.
|
||||
|
||||
Reference in New Issue
Block a user