martini-contrib/binding — pull request #21 by attilaolah (2014-04-23 18:59:37+00:00)
Title: Export NewErrors to make writing unit tests against validators easier

This way, when someone writes unit tests against structs that implements the `binding.Validator` interface, they don't have to manually set up the `*binding.Errors` parameter themselves. They can simply call `binding.NewError()`.

Note that this method is only intended to be used in tests. `binding` will take care of initialising the `*Errors` parameter before calling `Validate`.

Let me know if anyone has a better idea. I don't like exporting too much, and it bothers me somewhat that this is needed purely for testing. But I can't think of anything better.