goSmallTools

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: MIT Imports: 6 Imported by: 0

README

goSmallTools

go小工具

  • 驼峰转下划线
  • 下划线转驼峰
  • 处理字典数组转为MySQL where语句
  • 验证邮件地址
  • 验证手机号码
  • 时间比较

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckEmail added in v0.1.2

func CheckEmail(mail string) error

检查电子邮件地址

func CheckPhone added in v0.1.2

func CheckPhone(code string, phone string) error

验证手机号码

code	国家码
phone	电话号码

美国:001,加拿大:1

func HumpToUnderline

func HumpToUnderline(str string) string

驼峰转下划线

func ParameterToWhere

func ParameterToWhere(str string, cst *time.Location, timeFormat string) string

处理字典数组转为MySQL where语句

func TimeStampStrToTimeStr added in v0.1.3

func TimeStampStrToTimeStr(tsStr string, cst *time.Location, timeFormat string) (string, error)

时间戳字符串转时间字符串

ts		string		时间戳字符串10-19位
cst		*time.Location	时区
timeFormat	string		时间格式'2006-01-02 15:04:05'

func TimeStampToTimeStr added in v0.1.3

func TimeStampToTimeStr(ts int64, cst *time.Location, timeFormat string) string

时间戳转时间字符串

ts		int64		时间戳10-19位
cst		*time.Location	时区
timeFormat	string		时间格式'2006-01-02 15:04:05'

func UnderlineToHump

func UnderlineToHump(str string) string

下划线转驼峰

Types

This section is empty.

Jump to

Keyboard shortcuts

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