Skip to content

[feature request] let configuration methods return a pointer to the instance #93

@turtleDev

Description

@turtleDev
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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions