File: README.md

package info (click to toggle)
golang-github-jmoiron-sqlx 1.1%2Bgit20160206.61.398dd58-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 212 kB
  • ctags: 256
  • sloc: makefile: 3
file content (17 lines) | stat: -rw-r--r-- 686 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# reflectx

The sqlx package has special reflect needs.  In particular, it needs to:

* be able to map a name to a field
* understand embedded structs
* understand mapping names to fields by a particular tag
* user specified name -> field mapping functions

These behaviors mimic the behaviors by the standard library marshallers and also the
behavior of standard Go accessors.

The first two are amply taken care of by `Reflect.Value.FieldByName`, and the third is
addressed by `Reflect.Value.FieldByNameFunc`, but these don't quite understand struct
tags in the ways that are vital to most marshalers, and they are slow.

This reflectx package extends reflect to achieve these goals.