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

Adding the stringSplit macro to the Go template component #476

Merged
merged 3 commits into from Aug 27, 2023

Conversation

xenbyte
Copy link
Contributor

@xenbyte xenbyte commented Aug 23, 2023

When utilizing Cloudprober's Go template component to generate configuration files, a scenario arose in which I required the capability to divide a pre-defined string into a slice of strings. Regrettably, the absence of a suitable macro impeded this process. As a solution, I have introduced the stringSplit macro, which seamlessly employs the strings.Split() function to accomplish this task.

Copy link
Contributor

@manugarg manugarg left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, @xenbyte!

Please see the inline comments.

config/config_tmpl.go Outdated Show resolved Hide resolved
config/config_tmpl.go Outdated Show resolved Hide resolved
config/config_tmpl.go Outdated Show resolved Hide resolved
@xenbyte
Copy link
Contributor Author

xenbyte commented Aug 26, 2023

Hey @manugarg, just a heads up that I've removed the comments from the code document due to ongoing formatting glitches in my editor. It was causing some significant changes in the diffs. Also, I realized that my initial code description might not be exactly what you're looking for. So, if you could take a look and add your description, that'd be awesome! Thanks!

@manugarg manugarg merged commit 11189da into cloudprober:master Aug 27, 2023
8 checks passed
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.

None yet

2 participants