154 return cryptoutil.SHA1(str)
155}
156
157func ToUTF8WithErr(content []byte) (error, string) {158 charsetLabel, err := tool.DetectEncoding(content)
159 if err != nil {
160 return err, ""
Per convention, a function's error value should be its last return value.