conv

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TIME_DATE      string = "2006-01-02"
	TIME_NORMAL    string = "2006-01-02 15:04:05"
	TIME_SHORTDATE string = "20060102"
)

Variables

This section is empty.

Functions

func Bool

func Bool(val interface{}) (bool, bool)

func Float64

func Float64(val interface{}) (float64, bool)

func GbkToUtf8

func GbkToUtf8(s []byte) ([]byte, error)

func Int

func Int(val interface{}) (int, bool)

func Int64

func Int64(val interface{}) (int64, bool)

func IsNil

func IsNil(val interface{}) bool

func JsonToArray

func JsonToArray(ext string) ([]string, error)

JsonToArray 将shell命令的json字符转换成Array "{\"-a\":\"123\",\"-b\":\"hello\"}" ---> ["-a","123","-b","hello"]

func JsonToString

func JsonToString(ext string) (string, error)

JsonToString 将shell命令的json字符转换成string "{\"-a\":\"123\",\"-b\":\"hello\"}" ---> "-a 123 -b hello"

func String

func String(val interface{}) string

func StringToArray

func StringToArray(ext string) (array []string, err error)

StringToArray 将shell命令转换成Array "-a 123 -b hello" ---> ["-a","123","-b","hello"]

func StringToMap

func StringToMap(ext string) (map[string]string, error)

StringToMap 将shell命令转换成Map "-a 123 -b hello" ---> {"-a":"123","-b":"hello"}

func StructToMap

func StructToMap(in interface{}, tagName string) (map[string]interface{}, error)

StructToMap 结构体转为Map[string]interface{} chairou添加

func Time

func Time(val interface{}) (time.Time, bool)

func TimePtr

func TimePtr(val interface{}) *time.Time

func Uint

func Uint(val interface{}) (uint, bool)

func Uint64

func Uint64(val interface{}) (uint64, bool)

func Utf8ToGbk

func Utf8ToGbk(s []byte) ([]byte, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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