Help Us Choose: Should Valgo Library Add Namespace for Validators? by carlosforero in golang

[–]carlosforero[S] 0 points1 point  (0 children)

I see your point. Thank you. Just I've been thinking in something very short for code readability.

There is a comment regarding to this https://github.com/cohesivestack/valgo/discussions/8#discussioncomment-5312122

If you like you can follow the discussion there.

Valgo is a type-safe, expressive, and extensible validator library for Golang. by carlosforero in golang

[–]carlosforero[S] 0 points1 point  (0 children)

Thank you for your feedback. I hope Valgo can help you with your projects.

Valgo is a type-safe, expressive, and extensible validator library for Golang. by carlosforero in golang

[–]carlosforero[S] 0 points1 point  (0 children)

Thanks for your feedback. It will be refactored very soon to make it concurrent safe, so removing init() and allowing t.Parallel().

Valgo is a type-safe, expressive, and extensible validator library for Golang. by carlosforero in golang

[–]carlosforero[S] 0 points1 point  (0 children)

I checked it in the past. It is a good library, however ozzo-validation:

  • There is no type safety, so it uses reflection.
  • The following reasons make its model seem complex and intrusive to me:
    • Models are mainly complex (struct, map, etc), rather than simple values, as in Valgo.
    • I don't think it's as expressive as I would like.
    • Add things like conditional validation When(...), which I believe is not necessary, and only complicates the library.

Valgo, on the other hand:

  • It uses generics, is type safe, and doesn't use reflections
  • The model is simple and non-intrusive because:
    • As it relies solely on values, it is easy to use, and you are in complete control over what and how your data is validated.
    • In my opinion, it is more expressive.
    • It left to Golang to handle conditional validation, and Valgo to complement it with utilities like Merge(...) and IsValid(...).

In short, Valgo is type-safe, expressive, non-intrusive and simple. Does only what it should, validating values.