pkg/types: add tests for args

This commit is contained in:
Stefan Junker
2016-03-17 14:09:54 +01:00
parent b91aec9a62
commit 8916a7ea5f
4 changed files with 108 additions and 3 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)
}