atc0005 / go-nagios

Shared Golang package for Nagios plugins
MIT License
8 stars 3 forks source link

Add `Append` and `Prepend` methods for custom types (string base type) used for `ServiceOutput` and `LongServiceOutput` fields #208

Open atc0005 opened 1 year ago

atc0005 commented 1 year ago

Content below ported from scratch notes.

Goal is to provide new behavior without breaking changes.


Should allow adding at the end separated by custom EOL and at the very beginning.

This is all using the existing fields, but with a change in type (but still using base string type).

Option two is adding unexported slices that are used to collect values from methods.

EOL is not added until the very last result method call when all elements are processed.

If the existing ServiceOutput and LongServiceOutput fields fields have content then the behavior needs to be specific: should they be given precedence, or ignored?