hypnguyen1209 / goyml

YAML parser for Go that does not require schema

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

goyml

YAML parser for go that does not require schema

Go Reference

install

go get github.com/hypnguyen1209/goyml

usage

package main

import (
	"os"

	"github.com/hypnguyen1209/goyml"
)

func main() {
	test, _ := os.ReadFile("./test.yml")
	yq := goyml.Parse(test)
	d1, _ := yq.Int("age")
	d2, _ := yq.String("name")
	d3, _ := yq.ArrayOfStrings("work")
	println(d2, d1)
	for _, v := range d3 {
		println(v)
	}
}

Credit

About

YAML parser for Go that does not require schema

License:MIT License


Languages

Language:Go 100.0%