convert

package
v0.0.0-...-6bf0a34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Camel2Case

func Camel2Case(name string) string

驼峰式写法转为下划线写法

func Case2Camel

func Case2Camel(name string) string

下划线写法转为驼峰写法

func Case2LowerCamel

func Case2LowerCamel(name string) string

下划线写法转为驼峰写法

func Lcfirst

func Lcfirst(str string) string

首字母小写

func MapAnyToMapStr

func MapAnyToMapStr(p map[string]interface{}) map[string]string

func StrucToMap

func StrucToMap(param any, data any) any

*

  • @Description: 结构体map互转
  • @param param interface{} 需要被转的数据
  • @param data interface{} 转换完成后的数据 需要用引用传进来
  • @return []string{}

func StructAssign

func StructAssign(src interface{}, dst interface{}) interface{}

CopyStruct dst 目标结构体,src 源结构体 它会把src与dst的相同字段名的值,复制到dst中

func Ucfirst

func Ucfirst(str string) string

首字母大写

Types

type Buffer

type Buffer struct {
	*bytes.Buffer
}

内嵌bytes.Buffer,支持连写

func NewBuffer

func NewBuffer() *Buffer

func (*Buffer) Append

func (b *Buffer) Append(i interface{}) *Buffer

type StrTo

type StrTo string

func (StrTo) Int

func (s StrTo) Int() (int, error)

func (StrTo) Int64

func (s StrTo) Int64() (int64, error)

func (StrTo) MustInt

func (s StrTo) MustInt() int

func (StrTo) MustInt64

func (s StrTo) MustInt64() int64

func (StrTo) MustUInt32

func (s StrTo) MustUInt32() uint32

func (StrTo) String

func (s StrTo) String() string

func (StrTo) UInt32

func (s StrTo) UInt32() (uint32, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL