jsonutil

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package jsonutil provides safe JSON extraction helpers for CLI backend parsers. These functions extract typed values from map[string]any produced by encoding/json.Unmarshal. No transformation logic, no validation.

Exported within internal/ — visible to sibling packages (claude/, opencode/) but not to library consumers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsNull

func ContainsNull(s string) bool

ContainsNull reports whether s contains a null byte.

func GetFloat

func GetFloat(m map[string]any, key string) float64

GetFloat safely extracts a float64 field from a map.

func GetInt

func GetInt(m map[string]any, key string) int

GetInt safely extracts a numeric field as int from a map. JSON numbers are decoded as float64 by encoding/json.

func GetMap

func GetMap(m map[string]any, key string) map[string]any

GetMap safely extracts a nested map from a map.

func GetString

func GetString(m map[string]any, key string) string

GetString safely extracts a string field from a map.

Types

This section is empty.

Jump to

Keyboard shortcuts

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