A Go package for decoding HTTP form and query parameters into structs, maps, and slices with support for nested structures.
Formam is a Go library that decodes HTTP form and query parameters into complex Go data structures like structs, maps, and slices. It simplifies handling form data in web applications by providing a flexible, type-safe unmarshaling solution with support for nested structures and custom types.
Go developers building web applications that need to parse and validate HTTP form or query data into structured Go types, especially those dealing with complex nested data.
Developers choose Formam for its ability to handle infinite nesting, broad type support including custom types via encoding.TextUnmarshaler, and performance compared to alternatives like gorilla/schema, while minimizing boilerplate code.
a package for decode form's values into struct in Go
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports infinite nesting for structs, maps, and slices using dot notation and brackets, enabling complex form structures as shown in the HTML example with fields like 'Location.Country' and 'Products[0].Name'.
Decodes into a wide range of types including custom types via encoding.TextUnmarshaler, time.Time, url.URL, and interfaces, reducing manual parsing boilerplate for diverse data formats.
Benchmarked against alternatives like gorilla/schema and shows competitive performance, making it suitable for high-throughput web applications where speed is critical.
Allows registering custom decoding functions for specific fields or types, providing flexibility for handling unique data formats, as demonstrated in the time.Time parsing examples.
Focuses solely on unmarshaling without validation features, so developers must implement or integrate separate validation logic for error handling and data integrity, adding extra steps.
Setting up custom type decoding with RegisterCustomType can be verbose and complex, especially for multiple fields, as illustrated in the example with different time formats requiring separate registrations.
Designed specifically for HTTP form and query parameters, not suitable for other data formats like JSON or XML without additional work, which may limit its use in mixed-payload applications.