jsonpkg

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

README

json

JSON 序列化辅助,输出时不转义 HTML 字符。

基础用法

data, err := jsonpkg.MarshalWithoutEscapeHTML(v)
data, err = jsonpkg.MarshalIndentWithoutEscapeHTML(v, "", "  ")

注意事项

函数会保留 HTML 字符原样输出,并复制 buffer 内容后再归还复用池。

验证

go test ./json

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalIndentWithoutEscapeHTML

func MarshalIndentWithoutEscapeHTML(data any, prefix, indent string) ([]byte, error)

MarshalIndentWithoutEscapeHTML ...

func MarshalWithoutEscapeHTML

func MarshalWithoutEscapeHTML(data any) ([]byte, error)

MarshalWithoutEscapeHTML ...

Types

This section is empty.

Jump to

Keyboard shortcuts

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