package main import ( "fmt" "github.com/goadesign/goa/dslengine" ) func main() { errs := dslengine.ValidationErrors{} errs.Add("invalid value for field 'name'") errs.Add("invalid value for field 'email'") fmt.Println(errs.Error()) }
invalid value for field 'name' invalid value for field 'email'In this example, we create an empty `ValidationErrors` object and add two errors to it. We then call the `Error` method to get a string representation of the errors.