Skip to content
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

Merged
merged 1 commit into from
Aug 21, 2018
Merged

Add mapval doc.go #7944

merged 1 commit into from
Aug 21, 2018

Conversation

andrewvc
Copy link
Contributor

@andrewvc andrewvc commented Aug 10, 2018

Adds doc.go and doc_test.go for examples.

This is currently based on #7545 . Reviewing doesn't make sense until that is merged.

@andrewvc andrewvc added in progress Pull request is currently in progress. libbeat labels Aug 10, 2018
return strV, nil
}

var IsNonEmptyString = Is("is a non-empty string", func(path Path, v interface{}) *Results {

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


Examples of usage are found in doc_test.go
*/

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

@andrewvc andrewvc force-pushed the add_mapval_docs_root branch from b3bf473 to 73f3930 Compare August 10, 2018 18:00
@andrewvc andrewvc force-pushed the add_mapval_docs_root branch 2 times, most recently from ac2ca07 to ae7b64e Compare August 20, 2018 19:38
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.
@andrewvc andrewvc force-pushed the add_mapval_docs_root branch from ae7b64e to e068037 Compare August 20, 2018 19:47
@andrewvc andrewvc changed the title [WIP] Add mapval doc.go Add mapval doc.go Aug 20, 2018
@andrewvc andrewvc added review and removed in progress Pull request is currently in progress. labels Aug 20, 2018
/*
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.
Copy link
Contributor

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.

@ruflin ruflin merged commit 2719579 into elastic:master Aug 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants