I have source like the following:
type Record struct {
Message string `json:"message"`
Service string `json:"service"`
Success bool `json:"success"`
Error string `json:"error"`
}
func (zp *Zephyr) Write(err ...*error) {
if len(err) > 0 {
errPtr := err[0]
if errPtr != nil && *errPtr != nil {
// error occurred, set success to false and Error to the error message
zp.Success = false
zp.Error = errPtr
} else {
zp.Success = true
}
}
}
What I don't understand is how can I access the string that is embedded in errPtr
?