Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrFieldNotFound is returned when an operation is unable to find a target field. ErrFieldNotFound = errors.New("struct field not found") )
Functions ¶
func GetFieldTagValue ¶
GetFieldTagValue gets a tag value from a struct field. The tag is always returned as a string, independent of field type.
Example ```
s := Struct{ Value int `default:"100" validate:"required"` }{}
// Get the Value field default value tag := GetFieldTagValue(s, "Value", "default")
// Prints 100 fmt.Println(tag) ```
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.