Documentation ¶
Index ¶
- Constants
- func Camel2Case(XxYY string) string
- func Case2Camel(xx_y_y string) string
- func Case2CamelLowerStart(xx_y_y string) string
- func JsonToObject(jsonStr string, obj any) error
- func Lcfirst(str string) string
- func ObjectToJson(data any) string
- func ObjectToJsonCamel(data any) string
- func ObjectToJsonIndent(data any) string
- func ObjectToJsonSnake(data any) string
- func ObjectToJsonSnakeIdent(data any) string
- func SetCamelCaseJsonTag(v interface{})
- func SprintPrivateValue(data any) string
- func Ucfirst(str string) string
- func UnmarshalJSONIgnoreCase(data []byte, obj interface{}) error
- type JsonCamelCase
- type JsonSnakeCase
Constants ¶
View Source
const ( Camel = 0 //驼峰 Case = 1 //下划线 )
Variables ¶
This section is empty.
Functions ¶
func Camel2Case ¶
*
- 驼峰式写法转为下划线写法
- @description XxYx->xx_yy XxYY->xx_yy EncodeURL->url TagDTOList->tag_dto_list *
func Case2Camel ¶
*
- 下划线转驼峰
- @description xx_yy to XxYx xx_y_y to XxYY XxYY to XxYY
- @date 2023/2/15
- @param xx_y_y
- @return XxYY *
func Case2CamelLowerStart ¶
*
- 下划线转驼峰
- @description xx_yy to XxYx xx_y_y to XxYY XxYY to XxYY
- @date 2023/2/15
- @param xx_y_y
- @return xxYY *
func JsonToObject ¶
调用 JsonToObject(jsonStr , &obj)
func SprintPrivateValue ¶
func UnmarshalJSONIgnoreCase ¶
json解析忽略大小写
Types ¶
type JsonCamelCase ¶
type JsonCamelCase struct {
Value interface{}
}
************************************** 驼峰json **************************************
func (JsonCamelCase) MarshalJSON ¶
func (c JsonCamelCase) MarshalJSON() ([]byte, error)
转换为json,key全部变为下划线
type JsonSnakeCase ¶
type JsonSnakeCase struct {
Value interface{}
}
https://www.cnblogs.com/chenqionghe/p/13067596.html ************************************** 下划线json **************************************
func (JsonSnakeCase) MarshalJSON ¶
func (c JsonSnakeCase) MarshalJSON() ([]byte, error)
转换为json,key全部变为驼峰
Click to show internal directories.
Click to hide internal directories.