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

fix: Make splitList return []any #3604

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

bradenhilton
Copy link
Collaborator

Fixes #3603.

internal/cmd/templatefuncs.go Outdated Show resolved Hide resolved
internal/cmd/testdata/scripts/issue3603.txtar Outdated Show resolved Hide resolved
@bradenhilton bradenhilton changed the title fix: Make splitList output []interface{} fix: Make splitList return []any Feb 27, 2024
@bradenhilton
Copy link
Collaborator Author

@twpayne Is the solution in this playground better?

@twpayne
Copy link
Owner

twpayne commented Feb 28, 2024

Yes, that's much more flexible :)

@bradenhilton
Copy link
Collaborator Author

Ahh. I didn't realize that methods can't use generics. The code in that playground isn't applicable here.

Copy link
Owner

@twpayne twpayne left a comment

Choose a reason for hiding this comment

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

OK, let's merge this as-is. I think that in a separate PR we should replace more of the masterminds/sprig template functions with equivalent versions that accept a wider variety of types.

@bradenhilton bradenhilton merged commit dc99169 into twpayne:master Mar 1, 2024
21 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 8, 2024
@bradenhilton bradenhilton deleted the splitlist branch May 12, 2024 19:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

splitList and quoteList don't work in pair
3 participants