yaml

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package yaml converts JSON to YAML. Borrowed from https://github.com/itchyny/json2yaml v0.1.5 Copyright (c) 2022 itchyny, MIT licensed.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(w io.Writer, r io.Reader) error

Convert reads JSON from r and writes YAML to w.

Example
package main

import (
	"fmt"
	"log"
	"strings"

	json2yaml "github.com/MeGaNeKoS/neoma/yaml"
)

func main() {
	input := strings.NewReader(`{"Hello": "world!"}`)
	var output strings.Builder
	if err := json2yaml.Convert(&output, input); err != nil {
		log.Fatalln(err)
	}
	fmt.Print(output.String())
}
Output:
Hello: world!

Types

This section is empty.

Jump to

Keyboard shortcuts

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