From d8e3f3604e94b36de8a35085ae81e1ac2302c869 Mon Sep 17 00:00:00 2001 From: Victor Alves Date: Tue, 29 Oct 2019 09:34:26 +0100 Subject: [PATCH] add an alias for AddDetails method's functionality This change deprecates the method AddDetails over the method AppendDetails for more clarity. The functionality has not been changed. HH-129 --- herror/herror.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/herror/herror.go b/herror/herror.go index 9730d9b..3b7d61a 100644 --- a/herror/herror.go +++ b/herror/herror.go @@ -103,8 +103,14 @@ func (e *Err) Stack() *Stacktrace { return e.stack } -// AddDetails records variable info to the error mostly for debugging purposes +// AddDetails is a alias for AppendDetail [DEPRECATED] func (e *Err) AddDetails(v ...interface{}) *Err { + return e.AppendDetails(v...) +} + +// AppendDetails appends formated variable information at the end of a text +// field in the error mostly for debugging purposes. +func (e *Err) AppendDetails(v ...interface{}) *Err { buff := new(bytes.Buffer) fmt.Fprintln(buff, e.details) spew.Fdump(buff, v...)