Skip to content

v0.6.0

Compare
Choose a tag to compare
@moznion moznion released this 09 Nov 08:58
· 44 commits to main since this release
c8062ba

New Features

Support omitempty option on JSON marshaling #17

This version brings up the support for the omitempty option on JSON marshaling. If the property has that option and the value is None[T], it omits that property from the serialized JSON string.

example:

type JSONStruct struct {
	OmitemptyVal Option[string] `json:"omitemptyVal,omitempty"` // this should be omitted
}
jsonStruct := &JSONStruct{OmitemptyVal: None[string]()}
marshal, err := json.Marshal(jsonStruct)
if err != nil {
	return err
}
fmt.Printf("%s\n", marshal) // => {}

Maintenance

  • Add go1.19 checking in GitHub Actions #15
  • Update module github.com/stretchr/testify to v1.8.1 #16