Skip to content

Commit

Permalink
Add some comments to better set the context
Browse files Browse the repository at this point in the history
  • Loading branch information
Glib Smaga committed May 25, 2017
1 parent 9e63727 commit 20fa206
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions examples/vallie/vallie.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Package vallie stands in for a stand-alone validation library
// purely for discussion purposes.
//
// Assuming this is a desired approach, more fidelity will be added
// and vallie would be extracted into it's own repo
package vallie

import (
Expand All @@ -10,6 +15,10 @@ var errZeroVal = errors.New("Object is a zero value")

// Validate accepts objects to be validated from constructor and returns an error
// if any of the provided object is a zero value object
//
// TODO: if Validate returns an error, how can we hook into the dig resolution
// cycle to produce a meaningful error message, i.e.
// "failed to resolve Type3, because non-optional Type2 is not registered"
func Validate(values ...interface{}) error {
for _, val := range values {
v := reflect.ValueOf(val)
Expand Down

0 comments on commit 20fa206

Please sign in to comment.