Fix problems parsing

This commit is contained in:
Denis Isaev
2020-05-04 19:39:04 +03:00
parent b030249340
commit f7d08adb03
5 changed files with 11 additions and 4 deletions

View File

@ -4,11 +4,18 @@ package sample
import (
"crypto/md5"
"encoding/hex"
"errors"
)
// Hash~
func Hash(data string) string {
retError()
h := md5.New()
h.Write([]byte(data))
return hex.EncodeToString(h.Sum(nil))
}
func retError() error {
return errors.New("err")
}