Skip to content

SolarSystems-Software/ordered-object

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ordered-object

JSON objects that respect insertion order.

Usage

package main

import (
	"encoding/json"
	"fmt"
	orderedobject "github.com/SolarSystems-Software/ordered-object"
)

func main() {
	obj := new(orderedobject.Object[int])
	obj.Set("b", 0)
	obj.Set("a", 0)

	encoded, err := json.Marshal(obj)
	if err != nil {
		panic(err)
	}
	// outputs: {"b":0,"a":0}
	fmt.Println(string(encoded))
}

About

JSON objects that respect insertion order

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages