Help us shape the future of Go! Take the 2026 Go Developer Survey

value

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package value is the JSON-shaped data model shared by the script runtime and the matcher. Missing object keys are Absent, which is distinct from null.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsInt

func AsInt(v any) (int, bool)

AsInt accepts only finite, integral values representable by the platform int.

func AsMap

func AsMap(v any) (map[string]any, bool)

func AsSlice

func AsSlice(v any) ([]any, bool)

func Clone

func Clone(v any) (any, error)

func CompareNumbers

func CompareNumbers(a, b any) (int, bool)

func Format

func Format(v any) string

func IsAbsent

func IsAbsent(v any) bool

func IsNumber

func IsNumber(v any) bool

func JoinPath

func JoinPath(base, next string) string

func Kind

func Kind(v any) string

func Marshal

func Marshal(v any) ([]byte, error)

func Normalize

func Normalize(v any) any

Normalize copies v into the small set of types the matcher understands: nil, bool, int64, float64, string, []byte, []any, and map[string]any. Runtime-owned values (such as JS callbacks) stay opaque; caches validate them separately rather than sharing them across scenarios.

func NumbersEqual

func NumbersEqual(a, b any) (equal, ok bool)

func Parse

func Parse(b []byte) (any, error)

func ParseCSV

func ParseCSV(raw string) ([]any, error)

func Sprint

func Sprint(v any) string

func Truncate

func Truncate(s string, limit int) string

Types

type Absent

type Absent struct{}

Absent is a path that does not exist. It is not nil and not JSON null.

func (Absent) String

func (Absent) String() string

Jump to

Keyboard shortcuts

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