Skip to content

Commit e02e36e

Browse files
joeybloggsjoeybloggs
authored andcommitted
updated parse bool to native implementation + some code organizational cleanup.
1 parent 59fb57b commit e02e36e

File tree

5 files changed

+576
-562
lines changed

5 files changed

+576
-562
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package form
22
============
33
<img align="right" src="https://raw.githubusercontent.com/go-playground/form/master/logo.jpg">
4-
![Project status](https://img.shields.io/badge/version-1.1.0-green.svg)
4+
![Project status](https://img.shields.io/badge/version-1.2.0-green.svg)
55
[![Build Status](https://semaphoreci.com/api/v1/joeybloggs/form/branches/master/badge.svg)](https://semaphoreci.com/joeybloggs/form)
66
[![Coverage Status](https://coveralls.io/repos/github/go-playground/form/badge.svg?branch=master)](https://coveralls.io/github/go-playground/form?branch=master)
77
[![Go Report Card](https://goreportcard.com/badge/github.com/go-playground/form)](https://goreportcard.com/report/github.com/go-playground/form)
@@ -12,9 +12,11 @@ Package form parses url.Values and fills a struct with values, creating objects
1212

1313
It has the following features:
1414

15-
- Primitives types cause zero allocations.
15+
- Primitives types cause zero allocations.
1616
- 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.
1820
- Allows for Custom Type registration.
1921
- Handles time.Time using RFC3339 time format by default, but can easily be changed by registering a Custom Type, see below.
2022

@@ -37,7 +39,7 @@ Supported Types ( out of the box )
3739
* `slice`, `array`
3840
* `map`
3941
* `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
4143

4244
**NOTE**: `map`, `struct` and `slice` nesting are ad infinitum.
4345

@@ -55,8 +57,8 @@ Then import the form package into your own code.
5557
Usage
5658
-----
5759

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]`)
6062

6163
```html
6264
<form method="POST">

0 commit comments

Comments
 (0)