util

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyMap

func CopyMap(data map[string]interface{}) map[string]interface{}

func Escape

func Escape(src string) string

func EscapeStyle added in v0.1.4

func EscapeStyle(src string) string

EscapeStyle 和 html.EscapeString() 不同, EscapeStyle 不会再替换单引号 ', 因为单引号在style中是合法的.

func ForInterface

func ForInterface(s interface{}, cb func(index int, v interface{}) error) error

func GetSortedKey

func GetSortedKey(m interface{}) (keys []string)

func Interface2Slice

func Interface2Slice(s interface{}) (d []interface{})

func InterfaceToBool

func InterfaceToBool(s interface{}) (d bool)

字符串false,0 会被认定为false

func InterfaceToStr

func InterfaceToStr(s interface{}, escaped ...bool) (d string)

func UnsafeBytesToStr

func UnsafeBytesToStr(z []byte) string

func UnsafeStrToBytes

func UnsafeStrToBytes(s string) (b []byte)

Types

This section is empty.

Jump to

Keyboard shortcuts

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