
Add additional tests in github actions Support working directory for reading the version from go.mod
27 lines
380 B
Go
27 lines
380 B
Go
// Package main is used as test input for golangci action.
|
|
package main
|
|
|
|
import (
|
|
"crypto/md5"
|
|
"encoding/hex"
|
|
"errors"
|
|
)
|
|
|
|
// Hash~
|
|
func Hash(data string) string {
|
|
retError()
|
|
retError2()
|
|
|
|
h := md5.New()
|
|
h.Write([]byte(data))
|
|
return hex.EncodeToString(h.Sum(nil))
|
|
}
|
|
|
|
func retError() error {
|
|
return errors.New("err")
|
|
}
|
|
|
|
func retError2() error {
|
|
return errors.New("err2")
|
|
}
|