wk8 / go-ordered-map

Optimal implementation of ordered maps for Golang - ie maps that remember the order in which keys were inserted.
Apache License 2.0
532 stars 40 forks source link

Add YAML serialization #32

Closed wesen closed 1 year ago

wesen commented 1 year ago

I've been using go-ordered-map for my go-go-golems ecosystem, and since most of the work I do is actually based on yaml, I decided to add ordered map serialization and deserialization from YAML.

I mostly copy-pasted the unit tests (and kept the JSON syntax for a fair amount of them).

The serialization and deserialization itself is very simple, as I basically just delegate the marshalling to the underlying yaml.Node.

Fuzzing and unit tests all run.

wesen commented 1 year ago

@wk8 added!

wk8 commented 1 year ago

@wesen thanks a lot!

wesen commented 1 year ago

Thanks for merging. If you want, I can set up my scaffold for releasing / testing using github actions, I've done it like 28x times in the last couple of months.

wk8 commented 1 year ago

@wesen no worries, fixed a couple of things for tests in https://github.com/wk8/go-ordered-map/commit/85ca4a2b29d3241fa4513f82be3d38fe2392a791, and released a new version. Thanks!

wesen commented 1 year ago

cool! will you push it to pkg.go.dev (trying to bump a release on my dependency :)

wesen commented 1 year ago

v2.1.8 is there! thank you!