Skip to content

Releases: go-playground/form

Release 3.1.4

03 Feb 01:53
c78c4d6

Choose a tag to compare

What was fixed?

Fixed an array/slice index issue for the custom decode function, thanks @vearutop for reporting the issue

Release 3.1.3

10 Apr 05:15
572fa77

Choose a tag to compare

What was fixed?

Fixed encoder issue when omitempty used in combination with a pointer. see #34 for details, thanks @mifanich for reporting

Release 3.1.2

08 Apr 18:26

Choose a tag to compare

What was fixed?

Fixed bug introduced in v3.1.1 with array indexes

Release 3.1.1

08 Apr 17:04
6b988ba

Choose a tag to compare

What was fixed?

in PR #32:

  • Corrected handling of array, not slice, values that can lead to
    a panic.
  • Rearranged logic to handle multiple values if index and non-index are
    mixed eg. Value=[]string{"1","2"} Value[2]=[]string{"3"}

this resolves #29 and #30

Release 3.1.0

04 Feb 18:04
7fecd71

Choose a tag to compare

What was added

  • Added setting for string form value into interface{} values; previously they were ignored. thanks @Xzya for the issue

Why only string and not int, float etc...?
Because theres no way to tell what type the value should be; just because it CAN be parsed into an int, doesn't mean it should be for your application and so I have left it at setting strings.

Release 3.0.1

11 Sep 04:54

Choose a tag to compare

What was fixed?

empty boolean values are now set to false see here for details thanks @vearutop

Release 3.0.0

31 Jul 00:50

Choose a tag to compare

What's new?

  • Added Embedded struct support
  • Added omitempty just like std lib JSON

Made a version bump to v3.0.0 because the new Embedded struct logic has the potential to affect existing clients.

The Encoder has a new option SetAnonymousMode(...) by default it embeds anonymous struct info as if the fields were part of the containing struct itself; to continue to have it split out the Embedded structs just set mode to AnonymousSeparate and it will function exactly as previous versions.

please see examples detailing new functionality.

NOTE: if a struct and embedded struct have the same field, this will decode the value into both fields as there is no way to tell which you want; decoding into only the Embedded struct is still supported, again see examples.

Thanks to @danielchatfield and @michael2m for creating issues to get these features on the radar 👍

Release 2.3.0

16 Feb 00:37

Choose a tag to compare

What was added?

Added a new function to both the Decoder and Encoder called RegisterTagNameFunc.

NOTES:

Once a custom function has been registered the default, or custom set, tag name is ignored and relies 100% on the function for the field name data.

The return value WILL BE CACHED and so return value must be CONSISTENT.

Release 2.2.2

15 Feb 12:41

Choose a tag to compare

What was fixed?

  • Parsing of struct tag, by name, corrected for when multiple tags exists, this was corrected in #15 thanks @htmd

P.S. in the future, I will change this so that instead of specifying the tag name, a function will be specified allowing for greater flexibility; but it would be a breaking change so leaving for now until needed.

Release 2.2.1

13 Feb 01:55

Choose a tag to compare

What was fixed?

  • Added additional notes to RegisterCustomTypeFunc to indicate that if a struct type is registered a url.Value must exist explicitly for the struct and not just the fields.

eg. url.Values{"User":"Name%3Djoeybloggs"} will call the custom type function with User as the type, however url.Values{"User.Name":"joeybloggs"} will not.

Fixes #14