go

command
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

YAMLStar Go Example

This example demonstrates using the YAMLStar Go binding.

What it does

The yaml-to-json.go script loads ../sample.yaml and outputs it as formatted JSON, demonstrating:

  • Using the pure-Go YAMLStar module
  • Loading YAML files
  • Converting YAML to Go data structures
  • Outputting as JSON

Running the Example

make test

This will:

  1. Auto-install Go
  2. Run the script with go run yaml-to-json.go
With a custom YAML file

From within make shell:

go run yaml-to-json.go my-file.yaml

If no file is specified, it defaults to ../sample.yaml.

Expected Output

YAMLStar Example - Loading ../sample.yaml and outputting JSON

Input YAML:
name: YAMLStar Example
version: 0.1.21
...

---

Output JSON:
{
  "name": "YAMLStar Example",
  "version": "0.1.21",
  ...
}

Development Shell

Get a shell with Go set up:

make shell

This drops you into a bash shell with Go installed. The tools are installed locally to .cache/makes/ so they don't require system-wide installation.

Exit the shell with exit or Ctrl-D.

Dependencies

  • Go 1.24+
  • No cgo or shared library

The repository example imports the root github.com/yaml/yamlstar module. The published compatibility import path is github.com/yaml/yamlstar-go.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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