Commit Graph

12 Commits

Author SHA1 Message Date
9c3b63361d fix(validate): do not panic with field errors on non-struct types
When validating non-struct types, we should not try and convert field
values in errors, because there is no struct field to lookup. Hence this
fix stops a panic from happening.

It is up to the Validate() method itself to provide the correct and
final field value when validating non-struct types.
2021-08-23 12:55:24 +01:00
629f13e8aa chore(release): 0.1.0 v0.1.0 2021-08-22 22:18:01 +01:00
897255e008 Merge pull request #2 from romdo/add-coverage-and-readme-badges
chore: add coverage checks and readme badges
2021-08-22 22:14:27 +01:00
ce8f8dfabe docs(readme): add status badges 2021-08-22 22:10:33 +01:00
a15ed69b35 ci(github): add coverage reports via CodeClimate 2021-08-22 22:08:05 +01:00
51e78b6bda Merge pull request #1 from romdo/initial-implementation
feat(validate): initial implementation
2021-08-22 21:55:38 +01:00
2beadb2294 docs(readme): add basic information and example 2021-08-22 21:53:03 +01:00
0d7fd387a6 docs(examples): add a basic and a more complex example in examples dir 2021-08-22 21:53:02 +01:00
c1121a5575 ci(github): add GitHub Actions CI workflow
A few common workflows I normally use are commented out for now, I will
add them at a later date.
2021-08-22 21:53:02 +01:00
22972df8eb chore(makefile): add makefile with common tasks 2021-08-22 21:53:02 +01:00
464467ec86 feat(validate): initial implementation
This is a bare-bones implementation of a basic validation package based
around a very simply Validatable interface:

    type Validatable interface {
        Validate() error
    }

The goal is to keep things as simple as possible, while also giving as
much control as possible over how validation logic is performed.
2021-08-22 21:53:02 +01:00
9e4b022762 docs(readme): add basic readme and license 2021-08-20 03:24:04 +01:00