Releases: mozey/ft
Releases · mozey/ft
Valid flag is for null, not validation
- 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
- 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
Custom types implement encoding.TextMarshaler (the MarshalText method). They can now be used as JSON map keys, see for example TestNMapKeys