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

use src map if dst is nil and can't be set #177

Merged
merged 1 commit into from
Mar 3, 2021
Merged

Conversation

ndeloof
Copy link
Contributor

@ndeloof ndeloof commented Feb 18, 2021

As a struct field of type map is processed, and was not initialized as non-nil, don't try to set with a fresh new map and just adopt src value.
As I'm not sure about the potential side-effects, I've kept the original logic for cases where dst can be set.

fix #90

related:

@sourcelevel-bot
Copy link

Hello, @ndeloof! This is your first Pull Request that will be reviewed by SourceLevel, an automatic Code Review service. It will leave comments on this diff with potential issues and style violations found in the code as you push new commits. You can also see all the issues found on this Pull Request on its review page. Please check our documentation for more information.

issue90_test.go Outdated Show resolved Hide resolved
@sourcelevel-bot
Copy link

SourceLevel has finished reviewing this Pull Request and has found:

  • 1 possible new issue (including those that may have been commented here).

See more details about this review.

see darccio#90

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ulyssessouza
Copy link

Hello @imdario!
Could you please have a look at this PR, so I can continue with compose-spec/compose-go#106 that depends on it.

Thanks!

@darccio darccio self-assigned this Mar 3, 2021
@darccio darccio merged commit b617763 into darccio:master Mar 3, 2021
@darccio
Copy link
Owner

darccio commented Mar 3, 2021

@ulyssessouza Done. Thanks @ndeloof!

This was referenced Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panic: reflect: reflect.Value.Set using unaddressable value merging nested structures
3 participants