Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@gqcn
Copy link
Member

@gqcn gqcn commented Mar 25, 2025

fixed: #4218

@gqcn gqcn requested a review from wln32 March 25, 2025 12:28
@houseme houseme requested a review from Copilot March 28, 2025 05:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue with incompatible converting to a nil pointer target as described in issue #4218. The changes refactor the conversion logic in the converter to avoid a duplicated type check and add unit tests for the fixed behavior.

  • Refactored the Scan function in converter_scan.go to remove duplicate type checking and better handle nil pointer targets.
  • Added a new unit test in gconv_z_unit_issue_test.go addressing issue #4218.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
util/gconv/internal/converter/converter_scan.go Removed redundant type checking in Scan and improved nil pointer logic.
util/gconv/gconv_z_unit_issue_test.go Added unit test to validate conversion behavior for issue #4218.

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.

gvar/Scan: When the field is a pointer, it does not take effect

2 participants