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.
@@ -73,6 +74,11 @@ func (v *validate) FieldName() string {
7374 return v .cf .altName
7475}
7576
77+ // GetTag returns the tag name of field
78+ func (v * validate ) GetTag () string {
79+ return v .ct .tag
80+ }
81+
7682// StructFieldName returns the struct field's name
7783func (v * validate ) StructFieldName () string {
7884 return v .cf .name
You can’t perform that action at this time.
0 commit comments