Skip to content

Conversation

@jsoriano
Copy link
Member

@jsoriano jsoriano commented Dec 1, 2023

strings.Cut() was introduced in Go 1.18 for the common use case of splitting a string
in two parts. In these cases it allows to directly assign each one of the parts to variables
with more meaningful names, avoiding the risk of accessing indexes that may not exist,
and improving readability.

Leverage this function in some applicable uses cases we have here.

@jsoriano jsoriano requested a review from a team December 1, 2023 10:33
@jsoriano jsoriano self-assigned this Dec 1, 2023
Copy link
Contributor

@mrodm mrodm left a comment

Choose a reason for hiding this comment

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

Thanks

Co-authored-by: Mario Rodriguez Molins <marrodmo@gmail.com>
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @jsoriano

@jsoriano jsoriano merged commit 5329f5e into elastic:main Dec 4, 2023
@jsoriano jsoriano deleted the strings-cut branch December 4, 2023 12:09
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.

3 participants