I want to join two lines, but I get an error message.
Original:
hash := sha1.Sum([]byte(uf.Pwd))
u.Pwhash = hex.EncodeToString(hash[:])
Joint:
u.Pwhash = hex.EncodeToString(sha1.Sum([]byte(uf.Pwd))[:])
The first one works fine, the second produces the error message:
models/models.go:104: invalid operation sha1.Sum(([]byte)(uf.Pwd))[:] (slice of unaddressable value)
Why is that?