/mirror

:arrow_right_hook: Reflect utilities for Go data types.

Primary LanguageGoOtherNOASSERTION

mirror

Godoc Report Tests Coverage Sponsor

Reflect utilities for Go data types.

API

GetField

field, dataType, value, err := mirror.GetField(movie, "Title")
field, dataType, value, err := mirror.GetField(movie, "Director.Name")
field, dataType, value, err := mirror.GetField(movie, "Actors[0].Name")

Using simple queries:

field, dataType, value, err := mirror.GetField(movie, `Actors[Name="Tom Cruise"].Name`)

You can not use the . character in query strings yet. This is a bug that needs to be fixed sometime.

Style

Please take a look at the style guidelines if you'd like to make a pull request.

Sponsors

Cedric Fung Scott Rayapoullé Eduard Urbach
Cedric Fung Scott Rayapoullé Eduard Urbach

Want to see your own name here?