Skip to content

Replace vertical bars in Exit and Overall output#161

Open
martialblog wants to merge 1 commit into
mainfrom
replace-vertical-bar
Open

Replace vertical bars in Exit and Overall output#161
martialblog wants to merge 1 commit into
mainfrom
replace-vertical-bar

Conversation

@martialblog

Copy link
Copy Markdown
Member

This PR makes sure that any output does not contain vertical bars | so that the output won't conflict with the perfdata separator.

@martialblog martialblog self-assigned this Jun 19, 2026
@martialblog

Copy link
Copy Markdown
Member Author

@RincewindsHat I'm not 100% sure about this one. It's quite opinionated, on the other hand, I don't have to sanitize the strings in all check plugins.

What do you think?

@martialblog martialblog added this to the v1.0.0 milestone Jun 19, 2026
Comment thread exit.go

for _, s := range output {
text.WriteString(" " + s)
text.WriteString(" " + strings.ReplaceAll(s, "|", " "))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We cannot use the PerfdataSeparatorSymbol constant here, it would cause circular dependency.

I briefly though about moving the perfdata.go into the check package. That would also avoid having to use it like this perfdata.Perfdata and just be check.Perfdata

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@RincewindsHat thoughts? I think it would probably make sense

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.

1 participant