I optimize like this
// Copy returns a copy of hash.Hash
func (d *digest) Copy() hash.Hash {
dCopy := *d
return &dCopy
}
But I got error d1.Copy undefined (type hash.Hash has no field or method
Copy) with this code
d1 := sha256.New()
d2 := sha256.New()
d1.Write([]byte("a"))
fmt.Println(d1.Size())
d2 = d1.Copy()
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.