-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mapval doc.go #7944
Add mapval doc.go #7944
Conversation
libbeat/common/mapval/is_defs.go
Outdated
return strV, nil | ||
} | ||
|
||
var IsNonEmptyString = Is("is a non-empty string", func(path Path, v interface{}) *Results { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported var IsNonEmptyString should have comment or be unexported
libbeat/common/mapval/doc.go
Outdated
|
||
Examples of usage are found in doc_test.go | ||
*/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package comment is detached; there should be no blank lines between it and the package statement
b3bf473
to
73f3930
Compare
ac2ca07
to
ae7b64e
Compare
This cleans up the docs for mapval. The various Path related functions were public, and thus cluttering up the docs, though there was no need for them to be so. This adds examples and some high-level docs.
ae7b64e
to
e068037
Compare
/* | ||
Package mapval is used to validate JSON-like nested map data-structure against a set of expectations. Its key features are allowing custom, function defined validators for values, and allowing the composition of multiple validation specs. | ||
|
||
See the example below for more details. Most key functions include detailed examples of their use within this documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the doc_test
Example()` function will be show in the godocs? Nice, didn't know.
Adds doc.go and doc_test.go for examples.
This is currently based on #7545 . Reviewing doesn't make sense until that is merged.