Description
form is a Go package for encoding and decoding arbitrary Go values in application/x-www-form-urlencoded format and as url.Values. That is the format used by web forms and URL query strings. It is modeled on Go's encoding/json package and follows the same conventions, so a struct can be encoded to a form and decoded back with little extra work. The library aims to handle any concrete Go value except functions and channels, and it offers ways to customize behavior, including field tags. The README says the package is stable and in production use, and that its public API and wire format will not change incompatibly within the v1 series. It has an extensive unit suite, end-to-end HTTP tests and a native fuzz target seeded from past bugs. Its decoding is hardened against resource exhaustion and malformed input, with limits on slice growth, nesting depth and raw input size, and typed errors on every decode path. The README notes that it has not had a formal third-party security audit, so untrusted input needs care and the limits should be set. The only requirement is Go 1.17 or later.…
Highlights
- Encode and decode Go values as form data
- Works with url.Values and query strings
- Modeled on encoding/json conventions
- Limits for slice growth, nesting and input size
- Fuzz tests and end-to-end HTTP tests
Ratings & Reviews
No ratings yet
Be the first to rate Form.
People also visit
Csvutil
csvutil provides fast and idiomatic mapping between CSV and Go (golang) values
Form FAQ
What does the form package do?
It is a Go library that turns Go structs and values into form-encoded data and back, for web forms and URL query strings.
What version of Go do I need?
The README says the only requirement is Go 1.17 or later.
Is it stable?
The README says it is stable and in production use, and that the public API and wire format will not change incompatibly within the v1 series.
Has it been security audited?
The README says it has not undergone a formal third-party security audit. It advises careful handling of untrusted input and setting the available limits.
Does it follow any Go conventions?
Yes. The README says it is modeled after encoding/json and follows the same conventions.
What are the best Form alternatives?
Popular alternatives to Form include Concise Encoding, Palform and Formizee.. See all Form alternatives








