jsonutil

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureJSONResponse

func EnsureJSONResponse(ctx context.Context, text string, target interface{}) error

EnsureJSONResponse extracts and unmarshals valid JSON content from a given string into the target interface. It trims potential code block markers and identifies the JSON object or array to parse. Returns an error if unmarshalling fails. If no JSON payload is found, it returns nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

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