Documentation ¶
Index ¶
- Constants
- func Camel2Case(name string) string
- func Case2Camel(s string) string
- func DeepCopyByGob(src, dst interface{}) error
- func DeepCopyByReflect(src, dst interface{}) (err error)
- func DeepCopyByjsoniter(src, dst any) error
- func DeepCopyByjsoniterCamelOrCase(src, dst any, useCamel bool) error
- func JsonToObject(jsonStr string, obj any) error
- func Lcfirst(str string) string
- func ObjectToJson(data any) string
- func Ucfirst(str string) string
- type Buffer
- type JsonCamelCase
- type JsonSnakeCase
Constants ¶
View Source
const ( Camel = 0 //驼峰 Case = 1 //下划线 )
Variables ¶
This section is empty.
Functions ¶
func Case2Camel ¶
*
- 蛇形转驼峰
- @description xx_yy to XxYx xx_y_y to XxYY
- @date 2020/7/30
- @param s要转换的字符串
- @return string *
func DeepCopyByReflect ¶
func DeepCopyByReflect(src, dst interface{}) (err error)
src->dst 参数传递时,第src使用指针还是实例请自行斟酌,dst必须是指针,涉及的字段必须是对外的
func DeepCopyByjsoniterCamelOrCase ¶
驼峰式jsoniter
func JsonToObject ¶
调用 JsonToObject(jsonStr , &obj)
func ObjectToJson ¶
Types ¶
type JsonCamelCase ¶
type JsonCamelCase struct {
Value interface{}
}
************************************** 驼峰json **************************************
func (JsonCamelCase) MarshalJSON ¶
func (c JsonCamelCase) MarshalJSON() ([]byte, error)
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)
Click to show internal directories.
Click to hide internal directories.