pkg/types: add tests for args

This commit is contained in:
Stefan Junker
2016-03-17 14:09:54 +01:00
parent fc83c24eb5
commit dc44feb5b5
3 changed files with 107 additions and 2 deletions

View File

@ -47,9 +47,9 @@ type CommonArgs struct {
IgnoreUnknown UnmarshallableBool `json:"ignoreunknown,omitempty"`
}
// getKeyField is a helper function to receive Values
// GetKeyField is a helper function to receive Values
// Values that represent a pointer to a struct
func getKeyField(keyString string, v reflect.Value) reflect.Value {
func GetKeyField(keyString string, v reflect.Value) reflect.Value {
return v.Elem().FieldByName(keyString)
}