util

package
v0.1.2-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONMarshal

func JSONMarshal(t interface{}, escapeHtml bool) ([]byte, error)

json.Marshal()函数默认用HTMLEscape进行编码,它将替换“<”、“>”、“&”、U+2028和U+2029, 并将其转义为“\u003c”、“\u003e”、“\u0026”、“\ u2028”和“\u2029” 所以在这里做处理,判断是否开启转义

func Json2Struct

func Json2Struct(j string, s any) error

将json字符串转为struct

func TypeIsError

func TypeIsError(Type reflect.Type) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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