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

Skip to content

fix(gconv): fix scanning functionality for deep slice types#4272

Closed
fainc wants to merge 4 commits intogogf:masterfrom
fainc:master
Closed

fix(gconv): fix scanning functionality for deep slice types#4272
fainc wants to merge 4 commits intogogf:masterfrom
fainc:master

Conversation

@fainc
Copy link
Contributor

@fainc fainc commented May 6, 2025

@fainc fainc requested a review from gqcn May 8, 2025 08:21
@fainc fainc requested review from Copilot and hailaz May 21, 2025 01:55
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 the scanning functionality for deep slice types by updating the error handling logic when scanning each slice element and adding new test coverage for deep slice conversions.

  • Revised error handling in the scanning loop to conditionally return errors based on the ContinueOnError option.
  • Added unit tests for deep slice scanning functionality.

Reviewed Changes

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

File Description
util/gconv/internal/converter/converter_scan.go Updated error handling for scanning deep slice element types.
util/gconv/gconv_z_unit_scan_test.go Added tests to validate deep slice scanning functionality.

err = c.Scan(
srcElem, newSlice.Index(i).Addr().Interface(), option...,
)
if err != nil && !scanOption.ContinueOnError {
Copy link

Copilot AI May 21, 2025

Choose a reason for hiding this comment

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

Ensure that the modified error handling strategy with scanOption.ContinueOnError is intentional; if errors are being skipped on purpose, consider logging or documenting this behavior to aid in debugging partial conversions.

Copilot uses AI. Check for mistakes.
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.

2 participants