Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

executor: adds support for anonymous contained structs #371

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

@chris-ramon
Copy link
Member

@chris-ramon chris-ramon commented Jul 28, 2018

Overview

Test plan

  • go test ./...
@imjma
Copy link

@imjma imjma commented Sep 14, 2018

HI, wondering if there is any chance to merge this?

@mrg0lden
Copy link

@mrg0lden mrg0lden commented Oct 19, 2018

@chris-ramon @pavelnikolov Same question, would you please merge it?

@Niondir
Copy link

@Niondir Niondir commented Oct 22, 2018

Same here

@chris-ramon
Copy link
Member Author

@chris-ramon chris-ramon commented Oct 22, 2018

Thanks for letting us know how important this PR are for you guys.

I'll jump back to get this merge as soon as I get the chance today/tomorrow.

@chris-ramon chris-ramon force-pushed the anon-contained-struct branch from d376817 to d35d558 Oct 24, 2018
@coveralls
Copy link

@coveralls coveralls commented Oct 24, 2018

Coverage Status

Coverage increased (+0.009%) to 91.787% when pulling d35d558 on anon-contained-struct into a7e15c0 on master.

Ariel Salomon added 2 commits Jan 30, 2018
@raininfall
Copy link

@raininfall raininfall commented Nov 12, 2018

I think this will resolve the issue without using user-provided resolve function.

if typeField.Anonymous && typeField.Type.Kind() == reflect.Struct {
  anonymousResolvedValue, err := defaultResolveStruct(valueField, fieldName)
  if err != nil {
    return nil, err
  } else if anonymousResolvedValue != nil {
    return anonymousResolvedValue, nil
  }
}
@abraithwaite
Copy link

@abraithwaite abraithwaite commented Mar 4, 2019

Just commented on the issue, but just saw this PR. I'm still interested in this!

return valueField.Interface(), nil
}
if typeField.Anonymous && typeField.Type.Kind() == reflect.Struct {
return defaultResolveStruct(valueField, fieldName)

This comment has been minimized.

@abraithwaite

abraithwaite Mar 6, 2019

There's a bug here. We return too early if an anonymous struct comes before a field we're looking for.

I think what we want to do is run through all the top-level fields first, then dive if the field wasn't found.
Repeat for all anonymous structs until it's found. If not found, then return nil, nil.

This comment has been minimized.

@abraithwaite

abraithwaite Mar 6, 2019

Here's a fix, sans a proper test:

abraithwaite@5decd5b

This comment has been minimized.

@clery
Copy link

@clery clery commented Apr 1, 2019

Any news on this ?

@cettoana
Copy link

@cettoana cettoana commented May 30, 2019

Any updates on this PR?

@Niondir
Copy link

@Niondir Niondir commented Jun 13, 2019

Still waiting for the merge as qell...

@pavelnikolov
Copy link

@pavelnikolov pavelnikolov commented Jun 13, 2019

This PR has conflicts.

@SuNNjek
Copy link

@SuNNjek SuNNjek commented Aug 26, 2020

Is this still being worked on?

@pavelnikolov
Copy link

@pavelnikolov pavelnikolov commented Aug 26, 2020

Not that I am aware of

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.