package something
import (
"github.com/gorilla/schema"
)
var decoder = schema.NewDecoder().IgnoreUnknownKeys(true) // valid syntax
The syntax above is valid go, and is how the docs suggest you use gorilla (keeping a global instance)
however, doing this won't be valid
package something
import (
"github.com/gorilla/schema"
)
var decoder = schema.NewDecoder()
decoder.IgnoreUnknownKeys(true) // syntax-error: non-declaration statement outside function body
Sounds like a simple enough change. I'd be happy to send a PR.
What do you guys think?