jsonenc

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package jsonenc holds the JSON string escaper and the RFC 8259 number check used by jsonflat.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendEscaped

func AppendEscaped(dst, s []byte) []byte

AppendEscaped appends s with JSON string escaping applied, without quotes. Only the characters that RFC 8259 requires to be escaped are escaped. Bytes of 0x80 and above pass through unchanged, so valid UTF-8 stays valid.

func AppendQuoted

func AppendQuoted(dst, s []byte) []byte

AppendQuoted appends s as a JSON string, including the quotes.

func IsDigit

func IsDigit(c byte) bool

IsDigit reports whether c is an ASCII digit.

func ValidNumber

func ValidNumber(s []byte) bool

ValidNumber reports whether s is a number as defined by RFC 8259:

-? (0 | [1-9][0-9]*) (\.[0-9]+)? ([eE][+-]?[0-9]+)?

Types

This section is empty.

Jump to

Keyboard shortcuts

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