Golang实现md5校验 2022年3月29日2022年3月29日 不会飞的渡渡鸟 // 校验文件md5 func GetFileMd5(file_path string) string { File, err := os.Open(file_path) if err != nil { return "-----" } defer File.Close() md5h := md5.New() io.Copy(md5h, File) return hex.EncodeToString(md5h.Sum(nil)) }