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

Skip to content

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.

@TristonianJones TristonianJones requested a review from jpbetz April 29, 2023 01:37
Copy link
Contributor

@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
@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