UNO support for the Go language
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-29 20:24:05 +05:00
testdata Add DecodeFile() test 2026-11-17 16:01:12 +05:00
.gitignore Delete TODO list 2026-11-22 15:40:33 +05:00
consts.go Replace rune based parser with token based parser 2026-11-26 10:04:39 +05:00
decoder.go Fix empty key/value 2026-11-28 23:05:34 +05:00
encoder.go Add support of paierd values 2026-11-29 10:56:02 +05:00
error.go Replace rune based parser with token based parser 2026-11-26 10:04:39 +05:00
go.mod Fix module name 2026-11-15 15:48:55 +05:00
go.sum Upload code 2026-11-14 18:54:35 +05:00
logic.go Optimizations 2026-11-28 15:07:01 +05:00
pairedvalue.go Add support of paierd values 2026-11-29 10:56:02 +05:00
pairedvalue_test.go Add support of paierd values 2026-11-29 10:56:02 +05:00
README.md Update specification link 2026-11-29 11:56:17 +05:00
record.go Fix unnecessary decoding memory allocations 2026-11-29 20:24:05 +05:00
scanner.go Replace rune based parser with token based parser 2026-11-26 10:04:39 +05:00
sortkeys.go Sort map keys and add basic support of pointers 2026-11-15 11:54:06 +05:00
tags.go Replace rune based parser with token based parser 2026-11-26 10:04:39 +05:00
uno.go Optimizations 2026-11-28 15:07:01 +05:00
uno_test.go Add support of paierd values 2026-11-29 10:56:02 +05:00
values.go Optimizations 2026-11-28 15:07:01 +05:00

UNO support for the Go language

UNO stands from UNderstandable UNiversal NOtation of Objects. This Go package provides a reflection interface similar to Go's standard library json package.

This package currenlty targets UNO Core Specification.

Caution

Early alpha stage, use with caution.

Installation

go get github.com/nxshock/go-uno

Usage

Simple marshal/unmarshal

Marshal:

s := struct {
	A int
	B string
}{
	A: 123,
	B: "456"}

bytes, err := uno.Marshal(s)
fmt.Println(string(bytes)) // "A= 123\nB: 456\n"

Unmarshal:

bytes := []byte("A= 123\nB: 456\n")

s := struct {
	A int
	B string
}{}

err := uno.Unmarshal(bytes, &s) // err is uno.DecodeError struct with additional info like error line or expected/got values

fmt.Printf("%+v", s) // {A:123 B:456}

Raw unmarshal

bytes := []byte("A= 123\nB:\n\tB1: 456\n\tB2: 789")

var s map[string]any

err := uno.Unmarshal(bytes, &s)
fmt.Printf("%+v", s) // map[A:123 B:map[B1:456 B2:789]]