packagesignimport("bytes""crypto/sha512""encoding/hex""io/ioutil")// CheckContractHash computes the hash of the provided file and compares it to the expected one.funcCheckContractHash(filenamestring,expectedHashstring)(okbool,errerror){data,err:=ioutil.ReadFile(filename)iferr!=nil{return}expected,err:=hex.DecodeString(expectedHash)iferr!=nil{return}hash:=sha512.Sum512(data)ok=bytes.Equal(expected,hash[:])return}