Skip to content

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

Merged
darccio merged 1 commit intodarccio:masterfrom
ndeloof:master
Mar 3, 2021
Merged

use src map if dst is nil and can't be set#177
darccio merged 1 commit intodarccio:masterfrom
ndeloof:master

Conversation

@ndeloof
Copy link
Copy Markdown
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
Copy Markdown

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.

Comment thread issue90_test.go Outdated
@sourcelevel-bot
Copy link
Copy Markdown

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.

@ulyssessouza
Copy link
Copy Markdown

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
Copy Markdown
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