You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -12,9 +12,11 @@ Package form parses url.Values and fills a struct with values, creating objects
12
12
13
13
It has the following features:
14
14
15
-
- Primitives types cause zero allocations.
15
+
- Primitives types cause zero allocations.
16
16
- Supports map of almost all types.
17
-
- Supports both Numbered and Normal arrays i.e. "Array[0]" and just "Array" with multiple values passed.
17
+
- Supports both Numbered and Normal arrays eg. `"Array[0]"` and just `"Array"` with multiple values passed.
18
+
- Array honours the specified index. eg. if `"Array[2]"` is the only Array value passed down, it will be put at index 2; if array isn't big enough it will be expanded.
19
+
- Only creates objects as necessary eg. if no `array` or `map` values are passed down, the `array` and `map` are left as their default values in the struct.
18
20
- Allows for Custom Type registration.
19
21
- Handles time.Time using RFC3339 time format by default, but can easily be changed by registering a Custom Type, see below.
20
22
@@ -37,7 +39,7 @@ Supported Types ( out of the box )
37
39
*`slice`, `array`
38
40
*`map`
39
41
*`custom types` can override any of the above types
40
-
* many other types may be supported inherently (i.e. `bson.ObjectId` is `type ObjectId string`, which will get populated by the string type
42
+
* many other types may be supported inherently (eg. `bson.ObjectId` is `type ObjectId string`, which will get populated by the string type
41
43
42
44
**NOTE**: `map`, `struct` and `slice` nesting are ad infinitum.
43
45
@@ -55,8 +57,8 @@ Then import the form package into your own code.
55
57
Usage
56
58
-----
57
59
58
-
- Use symbol `.` for separating fields/structs. (i.e. `structfield.field`)
59
-
- Use `[index or key]` for access to index of a slice/array or key for map. (i.e. `arrayfield[0]`, `mapfield[keyvalue]`)
60
+
- Use symbol `.` for separating fields/structs. (eg. `structfield.field`)
61
+
- Use `[index or key]` for access to index of a slice/array or key for map. (eg. `arrayfield[0]`, `mapfield[keyvalue]`)
0 commit comments