Skip to content

sets: support json marshal/unmarshal#39

Merged
shoenig merged 1 commit intohashicorp:mainfrom
zonewave:main
Apr 24, 2023
Merged

sets: support json marshal/unmarshal#39
shoenig merged 1 commit intohashicorp:mainfrom
zonewave:main

Conversation

@zonewave
Copy link
Copy Markdown
Contributor

@zonewave zonewave commented Apr 14, 2023

Use serializable as a universal serialization interface。
set,treeSet,hashSet can use marshalJson/unmarshalJson to implement MarshalJSON/UnmarshalJSON

Closes #22

@hashicorp-cla
Copy link
Copy Markdown

hashicorp-cla commented Apr 14, 2023

CLA assistant check
All committers have signed the CLA.

@zonewave zonewave force-pushed the main branch 3 times, most recently from 2fceb2c to b840e78 Compare April 14, 2023 08:45
Copy link
Copy Markdown
Contributor

@shoenig shoenig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @zonewave, this looks great! The one thing I'd like to change in the future is to replace the Slice() call with iteration - but let's wait for golang/go#56413 (coming in Go 1.21?) so we can avoid creating the intermediate copy without dealing with implementation details for each type of Set.

@shoenig shoenig merged commit 6ea02bd into hashicorp:main Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add json encoding/decoding handlers

3 participants