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

Make slices.Map UnmarshalJSON a pointer receiver #655

Merged
merged 1 commit into from
Sep 18, 2022

Conversation

naemono
Copy link
Contributor

@naemono naemono commented Jun 11, 2021

Fixes #654

@naemono naemono requested a review from a team as a code owner June 11, 2021 20:45
@aeneasr
Copy link
Member

aeneasr commented Aug 10, 2021

Could you add a test please? Thank you!

@qindj
Copy link

qindj commented Aug 29, 2022

I have the same issue, value will be nil when slices.map used as a table's column type

@sio4 sio4 changed the base branch from main-original to main September 17, 2022 15:30
@sio4 sio4 force-pushed the map-unmarshal-pointer-receiver branch from 4a801ab to 834c3c3 Compare September 17, 2022 15:31
@@ -47,17 +47,17 @@ func (m Map) Value() (driver.Value, error) {

// UnmarshalJSON will unmarshall JSON value into
// the map representation of this value.
func (m Map) UnmarshalJSON(b []byte) error {
func (m *Map) UnmarshalJSON(b []byte) error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be! Thanks for correcting the code!

@sio4
Copy link
Member

sio4 commented Sep 18, 2022

I will cover the test cases myself. Thanks!

@sio4 sio4 merged commit 32ad898 into gobuffalo:main Sep 18, 2022
@sio4 sio4 self-assigned this Sep 18, 2022
@sio4 sio4 added the bug Something isn't working label Sep 18, 2022
@sio4 sio4 added this to the v6.0.7 milestone Sep 18, 2022
sio4 added a commit that referenced this pull request Sep 18, 2022
sio4 added a commit that referenced this pull request Sep 18, 2022
@sio4 sio4 mentioned this pull request Sep 20, 2022
30 tasks
@sio4 sio4 added the s: fixed was fixed or solution offered label Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working s: fixed was fixed or solution offered
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shouldn't the slices.Map receiver for UnmarshalJSON be a pointer?
4 participants