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

fix: change isPtr to true on listElemCode #379

Merged
merged 1 commit into from Jul 7, 2022
Merged

Conversation

orisano
Copy link
Sponsor Contributor

@orisano orisano commented Jul 4, 2022

fix #370

@codecov-commenter
Copy link

codecov-commenter commented Jul 4, 2022

Codecov Report

Merging #379 (565e07e) into master (1468eef) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #379      +/-   ##
==========================================
+ Coverage   79.93%   79.94%   +0.01%     
==========================================
  Files          52       52              
  Lines       17565    17576      +11     
==========================================
+ Hits        14040    14051      +11     
  Misses       2957     2957              
  Partials      568      568              

@@ -487,7 +487,7 @@ func (c *Compiler) listElemCode(typ *runtime.Type) (Code, error) {
case typ.Kind() == reflect.Map:
return c.ptrCode(runtime.PtrTo(typ))
default:
code, err := c.typeToCodeWithPtr(typ, false)
code, err := c.typeToCodeWithPtr(typ, true)
Copy link
Owner

Choose a reason for hiding this comment

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

Hmm..., I feel that the fix to set isPtr to true is not correct to fix this issue (
since elem is not ptr type )

Copy link
Sponsor Contributor Author

@orisano orisano Jul 6, 2022

Choose a reason for hiding this comment

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

I added a comment!

@goccy goccy merged commit 8459403 into goccy:master Jul 7, 2022
@goccy
Copy link
Owner

goccy commented Jul 7, 2022

Thanks !

goccy added a commit that referenced this pull request Jul 7, 2022
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.

Defferent behavior from "encoding/json" for MarshalJSON
3 participants