Skip to content

Releases: mozey/ft

Valid flag is for null, not validation

17 Sep 10:31
8f0d579
Compare
Choose a tag to compare
  • UnmarshalText for JSON map keys #1
  • Valid is set if the value is defined (not null), don't use it for e.g. form validation 8f0d579. Valid property is only for ft.N* types

Not updating major version to avoid this issue golang/go#58654. That is, importing "github.com/mozey/ft/v2" requires a change to go.mod. No downstream users depended on the property that was removed

Verify map key error messages

17 May 10:19
0c49c14
Compare
Choose a tag to compare
  • Invalid ft.String, .Int, .Float, and .Bool error on MarshalText. Map keys must be valid
  • Invalid values are marshalled to JSON as is, unlike ft.N types where the JSON value is null when the Valid flag is false
  • Fixed a typo in the error message for ft.NBool.MarshalText
  • Tests to verify map key error messages

Implement encoding.TextMarshaler

17 May 05:55
076fc46
Compare
Choose a tag to compare

Custom types implement encoding.TextMarshaler (the MarshalText method). They can now be used as JSON map keys, see for example TestNMapKeys

Initial release

16 May 12:28
fd21629
Compare
Choose a tag to compare
  • Finalised v1 API (ignore v1.0.0 tag, oops)
  • Consistent interface
  • Text template tests