json

package
v0.0.0-...-52ea55a Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 4 Imported by: 0

README

Package json provides minimal json string escaping. It is extracted from https://github.com/go-json-experiment/json.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidUTF8 = errors.New("invalid UTF-8")

Functions

func AppendString

func AppendString(dst []byte, src string) ([]byte, error)

appendString appends src to dst as a JSON string per RFC 7159, section 7. This rejects input that contains invalid UTF-8.

func EscapeString

func EscapeString(s string) (string, error)

EscapeString escapes JSON string contents. It does not add quotes around it. It returns ErrInvalidUTF8 if s contains invalid UTF-8. That is the only possible error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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