json

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func YAMLToJSON

func YAMLToJSON(node *yaml.Node, indentation int, buffer io.Writer) error

YAMLToJSON converts a YAML node to JSON using a custom JSON writer that preserves formatting. This approach is particularly useful when the YAML nodes already represent JSON input (since the yaml decoder can parse JSON), and we want to preserve the original JSON formatting.

func YAMLToJSONWithConfig added in v1.11.0

func YAMLToJSONWithConfig(node *yaml.Node, indent string, indentCount int, trailingNewline bool, buffer io.Writer) error

YAMLToJSONWithConfig converts YAML to JSON with full control over formatting. When the input nodes already have JSON-style formatting (from JSON input), this preserves it by analyzing Line and Column metadata to recreate the original formatting.

Types

This section is empty.

Jump to

Keyboard shortcuts

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