Skip to content

Conversation

flimzy
Copy link
Contributor

@flimzy flimzy commented Jan 10, 2017

This fixes a corner case with binding to structs with untagged fields. For example, given a struct type FooStruct, which implements the BindUnmarshaler interface, the following code did not work previously when passed to c.Bind():

type Fields struct {
    Foo FooStruct
}

But this would have:

type Fields struct {
    Foo FooStruct `query:"Foo"`
}

This PR fixes the former case to also work.

A BindUnmarshaler struct with no tag is not decoded properly.
@coveralls
Copy link

coveralls commented Jan 10, 2017

Coverage Status

Coverage decreased (-0.2%) to 86.149% when pulling 4146e43 on flimzy:untagged-structs into 63262b2 on labstack:master.

@vishr
Copy link
Member

vishr commented Jan 11, 2017

@flimzy You have some print statements in the code.

@flimzy
Copy link
Contributor Author

flimzy commented Jan 11, 2017

Oops. I'll fix that and update the PR tomorrow. Thanks for checking.

@flimzy
Copy link
Contributor Author

flimzy commented Jan 13, 2017

@vishr Should now be cleaned up.

@vishr
Copy link
Member

vishr commented Jan 14, 2017

@flimzy are you sure?

@flimzy
Copy link
Contributor Author

flimzy commented Jan 14, 2017

:/

I forgot the -f flag with my push. Now it's updated.

@coveralls
Copy link

coveralls commented Jan 14, 2017

Coverage Status

Coverage decreased (-0.1%) to 85.374% when pulling f98e483 on flimzy:untagged-structs into 9797cf4 on labstack:master.

@vishr vishr force-pushed the master branch 3 times, most recently from 82e4605 to 093edb3 Compare January 15, 2017 20:56
@vishr vishr merged commit ed7353c into labstack:master Jan 16, 2017
@flimzy flimzy deleted the untagged-structs branch January 16, 2017 12:06
@vishr vishr self-assigned this Apr 26, 2017
@vishr vishr added the bug label Apr 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants