Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

How to perform data validations programatically? #810

Answered by mpvl
joanlopez asked this question in Q&A
Discussion options

You must be logged in to vote

There is an extensive API for this. See cuelang.org/go/cue, cuelang.org/go/cue/load and friends.

Validation is typically done by getting two cue.Values and unify them using cue.Unify. The Validate method allows you to be more specific about which errors to get.

You can also validate Go values directly. See cuelang.org/go/encoding/gocode.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by joanlopez
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants