File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import "reflect"
55// FieldLevel contains all the information and helper functions
66// to validate a field
77type FieldLevel interface {
8-
98 // returns the top level struct, if any
109 Top () reflect.Value
1110
@@ -26,6 +25,8 @@ type FieldLevel interface {
2625 // returns param for validation against current field
2726 Param () string
2827
28+ GetTag () string
29+
2930 // ExtractType gets the actual underlying type of field value.
3031 // It will dive into pointers, customTypes and return you the
3132 // underlying value and it's kind.
@@ -57,6 +58,11 @@ func (v *validate) FieldName() string {
5758 return v .cf .altName
5859}
5960
61+ // GetTag returns the tag name of field
62+ func (v * validate ) GetTag () string {
63+ return v .ct .tag
64+ }
65+
6066// StructFieldName returns the struct field's name
6167func (v * validate ) StructFieldName () string {
6268 return v .cf .name
You can’t perform that action at this time.
0 commit comments