Skip to content

Add support for nested element type #1190

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

MisLink
Copy link

@MisLink MisLink commented Jun 24, 2025

Recursively find all Struct types, covering the containment of pointer types in the container.

@Copilot Copilot AI review requested due to automatic review settings June 24, 2025 18:00
Copy link

google-cla bot commented Jun 24, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link

@Copilot 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 enhances the native type provider to recursively unwrap nested pointer/slice/array/map containers down to their underlying struct types, and adds a new test to verify that behavior for a slice of pointers.

  • Recursively handle multiple container layers in newNativeTypes
  • Add TestNativeNestedStruct to validate nested element support

Reviewed Changes

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

File Description
ext/native.go Changed unwrapping logic to recurse through nested containers
ext/native_test.go Introduced TestNestedStruct and TestNativeNestedStruct test case
Comments suppressed due to low confidence (1)

ext/native_test.go:949

  • To ensure full container support, consider adding test cases for nested maps, arrays, and multiple pointer layers, not just slices of pointers.
	var nativeTests = []struct {

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.

1 participant