Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
schema
✓ github.com/gorilla/schema
Decode form values into a struct using gorilla/schema.
package main
import (
"fmt"
"github.com/gorilla/schema"
)
type Person struct {
Name string
Phone struct {
Label string
Number string
}
}
func main() {
values := map[string][]string{
"Name": {"John"},
"Phone.Label": {"Home"},
"Phone.Number": {"123-456"},
}
var p Person
decoder := schema.NewDecoder()
decoder.Decode(&p, values)
fmt.Printf("%+v\n", p)
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
1.4.1latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.