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

Update the ConvertToNative API documentation and strings.join #692

Merged
merged 1 commit into from Apr 29, 2023

Conversation

TristonianJones
Copy link
Collaborator

Update the ConvertToNative API docs to clarify the call contract.

The change also introduces a refactor of the strings.join method which
does not rely on ConvertToNative, but rather uses the traits.Lister with
an expectation that all contained elements will be types.String values.

This change can be taken advantage of using ext.StringsVersion(2) if
you are using extension versioning. If you are not using extension versioning,
the change will be default enabled.

The functionality should be equivalent with the prior behavior, though there
are some limited cases where a ConvertToNative might succeed when
the new approach might fail.

Closes #688

@TristonianJones
Copy link
Collaborator Author

@jpbetz let me know if this addresses your use case, and also whether the updated functionality will work with your object types.

Copy link
Collaborator

@jpbetz jpbetz left a comment

Choose a reason for hiding this comment

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

This looks great. Thanks @TristonianJones !

@TristonianJones TristonianJones merged commit d651ee2 into google:master Apr 29, 2023
2 checks passed
@TristonianJones TristonianJones deleted the string-join-redo branch April 29, 2023 03:23
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.

Unexpected behavior: string.join relies on ConvertToNative returning a []string
2 participants