This repository has been archived on 2025-03-30. You can view files and clone it, but cannot push or open issues or pull requests.
bactdb/types/validation-error.go
2015-10-13 15:28:44 -07:00

17 lines
266 B
Go

package types
import "encoding/json"
type ValidationError map[string][]string
func (v ValidationError) Error() string {
errs, err := json.Marshal(struct {
ValidationError `json:"errors"`
}{v})
if err != nil {
return err.Error()
}
return string(errs)
}