Documentation ¶
Index ¶
- Constants
- func AnyToAny(data any, obj any) (err error)
- func AnyToAnyNE[T any](data any) (out *T)
- func AnyToJson(data any) (string, error)
- func AnyToJsonCamel(data any) string
- func AnyToJsonIndent(data any) string
- func AnyToJsonNE(data any) string
- func AnyToJsonSnake(data any) string
- func AnyToMap(obj interface{}) (map[string]interface{}, error)
- func AnyToMapNE(obj interface{}) map[string]interface{}
- func Case2Camel(xx_y_y string) string
- func Case2Snake(XxYY string) string
- func ExtractLetters(s string) string
- func FirstLower(s string) string
- func FirstUpper(s string) string
- func JsonToAny(js string, obj any) error
- func JsonToAnyIgnoreCase(data string, obj interface{}) error
- func JsonToAnyNE[T any](js string) (out T)
- func JsonToMap(data []byte) (map[string]interface{}, error)
- func JsonToMapNE(data []byte) map[string]interface{}
- type JsonCamelCase
- type JsonSnakeCase
Constants ¶
View Source
const ( Camel = 0 //驼峰 Case = 1 //下划线 )
Variables ¶
This section is empty.
Functions ¶
func AnyToAnyNE ¶
func AnyToJsonNE ¶
func AnyToJsonSnake ¶
************************************** 其他方法 ************************************** 转下划线json
func AnyToMapNE ¶
func AnyToMapNE(obj interface{}) map[string]interface{}
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 Case2Snake ¶
*
- 驼峰式写法转为下划线写法
- @description XxYx->xx_yy XxYY->xx_yy EncodeURL->url TagDTOList->tag_dto_list *
func JsonToMapNE ¶
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.