Yes. The Write method takes a slice of bytes ([]byte), but you're
trying to give it a string. You can convert your string to a slice of
bytes by changing your second line to:
hash.Write([]byte("hello go rocks"))
Converting to []uint8 should work equally well, as byte and uint8 are
aliases for the same type.
- Evan
if you want to calculate the hash of a file, the interface makes it dead easy:
e.g.
h := md5.New()
io.Copy(h, os.Stdin)
fmt.Printf("%x\n", h.Sum())