Documentation
¶
Index ¶
Constants ¶
View Source
const ( JSONTag = "json" JSONOmitempty = "omitempty" )
View Source
const ( ErrEmptyJSONTag = "empty json tag for field: %s" ErrJSONTagNotFound = "json tag not found for field: %s" )
Variables ¶
This section is empty.
Functions ¶
func GetJSONTag ¶
func GetJSONTag(structField *reflect.StructField, fieldName string) (string, error)
GetJSONTag returns the JSON tag for a given struct field
Parameters:
- structField: The struct field - fieldName: The name of the struct field
Returns:
- string: JSON tag - error: error if the field does not exist
func GetJSONTagName ¶
GetJSONTagName returns the JSON tag name for a given struct field name
Parameters:
- jsonTag: The JSON tag of the struct field - fieldName: The name of the struct field
Returns:
- string: JSON tag name - error: error if the JSON tag is empty
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.