Skip to content

Instantly share code, notes, and snippets.

View soolaugust's full-sized avatar
🐌
Focus

soolaugust soolaugust

🐌
Focus
View GitHub Profile
@soolaugust
soolaugust / md5.go
Created July 23, 2021 03:55
get self md5 in Golang
// GetSelfMD5 get md5 of current program
func GetSelfMD5() string {
path, e := exec.LookPath(os.Args[0])
if e != nil {
log.Println(`Self md5sum error: look path fail:`, e)
return ""
}
bs, e := ioutil.ReadFile(path)
if e != nil {
log.Println(`SelfMd5sum error: read file fail:`, e)