Skip to content

Conversation

@Succo
Copy link

@Succo Succo commented Jan 17, 2025

It is more efficient since it does not allocate an array and just return s if nothing found

For the same reason we don't need to use strings.Cut at all if empty

It is more efficient since it does not allocate an array and just return
s if nothing found

For the same reason we don't need to use  strings.Cut at all if empty
}
tagValue = strings.SplitN(tagValue, ",", 2)[0]
if tagValue != "" {
tagValue, _, _ = strings.Cut(tagValue, ",")
Copy link

Choose a reason for hiding this comment

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

I think this change breaks the behavior of a tag without a name: https://go.dev/play/p/Hu0LR1FDKqi
strings.SplitN or strings.Cut should be out of an if block.

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