Skip to content

Validate Go Datastructures Based on How Similar They Look

License

Notifications You must be signed in to change notification settings

elastic/go-lookslike

Repository files navigation

lookslike

Build Status

This library is here to help you with all your data validation needs. It's ideally suited to writing tests against JSON-like structures, but can do much much more. We use it in elastic/beats for our own tests.

Quick Links

Install

If using go modules edit go.mod, adding the following to your require list, replacing VERSION, with the latest version from our releases page.

require (
  github.com/elastic/go-lookslike VERSION
)

If using govendor run:

govendor fetch github.com/elastic/go-lookslike

Real World Usage Examples

lookslike was created to improve the testing of various structures in elastic/beats. Searching the tests for lookslike.MustCompile will show real world usage.

Call for More isdefs!

We currently define only the isdefs we've actually used in the field. If you'd like to add your own, please open a PR (with tests!).