func ConvertError(key string, err error) Errors {
	converted := Error{Message: err.Error(), Key: key}
	return Errors{key: []Error{converted}}
}
ConvertError turns a native error into a validation Errors struct.
package validation
import (
	"fmt"
	"go-webapp-example/pkg/i18n"
	"github.com/pkg/errors"
)
var ErrFailed = errors.New("validation failed")
type Errors map[string][]Error
type ErrorBag struct {
	errors  Errors
	subject string
}
type Error struct {
	Key        string            `json:"key"`
	Message    string            `json:"message"`
	Translated string            `json:"translated"`
	Data       map[string]string `json:"data"`
}
func NewErrorBag(subject string) *ErrorBag {
	return &ErrorBag{
		subject: subject,
		errors:  make(Errors),
	}
}