func (r *Result) MarshalJSON() (data []byte, err error) {
	var stringError string
	if r.Error != nil {
		stringError = r.Error.Error()
	}
	type alias Result
	return json.Marshal(&struct {
		*alias
		Error string `json:"error"`
	}{
		alias: (*alias)(r),
		Error: stringError,
	})
}
MarshalJSON is custom marshaler for result
package transaction
import (
	"encoding/json"
	"fmt"
	"time"
)
type Result struct {
	UUID            string            `json:"uuid" yaml:"uuid"`
	Name            string            `json:"name" yaml:"name"`
	Driver          string            `json:"driver" yaml:"driver"`
	Failed          bool              `json:"failed" yaml:"failed"`
	Message         string            `json:"message" yaml:"message"`
	Data            string            `json:"data" yaml:"data"`
	Time            time.Time         `json:"time" yaml:"time"`
	Error           error             `json:"-" yaml:"-"`
	Metadata        map[string]string `json:"metadata" yaml:"metadata"`
	RetryCount      int               `json:"retry_count" yaml:"retry_count"`
	WithCallback    bool              `json:"with_callback" yaml:"with_callback"`
	DurationSeconds float64           `json:"duration_seconds" yaml:"duration_seconds"`
}