From 1e9c0bd6df6eac87e75b89b2321da98e7fe64ca8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 13:56:58 +0000 Subject: [PATCH] Go Dependency: Bump github.com/atc0005/go-nagios Bumps [github.com/atc0005/go-nagios](https://github.com/atc0005/go-nagios) from 0.17.0-alpha.6 to 0.17.0-alpha.7. - [Release notes](https://github.com/atc0005/go-nagios/releases) - [Changelog](https://github.com/atc0005/go-nagios/blob/master/CHANGELOG.md) - [Commits](https://github.com/atc0005/go-nagios/compare/v0.17.0-alpha.6...v0.17.0-alpha.7) --- updated-dependencies: - dependency-name: github.com/atc0005/go-nagios dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- vendor/github.com/atc0005/go-nagios/sections.go | 16 ++++++++++++---- vendor/modules.txt | 2 +- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 93784605..6eaae268 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/atc0005/check-cert go 1.20 require ( - github.com/atc0005/go-nagios v0.17.0-alpha.6 + github.com/atc0005/go-nagios v0.17.0-alpha.7 github.com/grantae/certinfo v0.0.0-20170412194111-59d56a35515b github.com/rs/zerolog v1.33.0 ) diff --git a/go.sum b/go.sum index 4d30eede..662311d8 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/atc0005/go-nagios v0.17.0-alpha.6 h1:N7myS61mkmwGys3k5SvZfAKvCZzoc5s2rDyWbLkWwMw= -github.com/atc0005/go-nagios v0.17.0-alpha.6/go.mod h1:n2RHhsrgI8xiapqkJ240dKLwMXWbWvkOPLE92x0IGaM= +github.com/atc0005/go-nagios v0.17.0-alpha.7 h1:DgA97FWJwIvVtXqf+u9IY7oTCLDDwvTOcPFoPGXv7ok= +github.com/atc0005/go-nagios v0.17.0-alpha.7/go.mod h1:n2RHhsrgI8xiapqkJ240dKLwMXWbWvkOPLE92x0IGaM= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= diff --git a/vendor/github.com/atc0005/go-nagios/sections.go b/vendor/github.com/atc0005/go-nagios/sections.go index ec53beca..40ce482f 100644 --- a/vendor/github.com/atc0005/go-nagios/sections.go +++ b/vendor/github.com/atc0005/go-nagios/sections.go @@ -170,15 +170,17 @@ func (p Plugin) handleLongServiceOutput(w io.Writer) { var totalWritten int // Hide section header/label if threshold and error values were not - // specified by client code or if client code opted to explicitly hide - // those sections; there is no need to use a header to separate the - // LongServiceOutput from those sections if they are not displayed. + // specified by client code, if client code opted to explicitly hide + // threshold or error sections or if no encoded payload content was + // provided; there is no need to use a header to separate the + // LongServiceOutput from those sections if they are not displayed (or + // provided in the case of an encoded payload). // // If we hide the section header, we still provide some padding to // prevent the LongServiceOutput from running up against the // ServiceOutput content. switch { - case !p.isThresholdsSectionHidden() || !p.isErrorsHidden(): + case !p.isThresholdsSectionHidden() || !p.isErrorsHidden() || !p.isPayloadSectionHidden(): written, err := fmt.Fprintf(w, "%s**%s**%s", CheckOutputEOL, @@ -366,6 +368,12 @@ func (p Plugin) isErrorsHidden() bool { return false } +// isPayloadSectionHidden indicates whether the Payload section should be +// omitted from output. +func (p Plugin) isPayloadSectionHidden() bool { + return p.encodedPayloadBuffer.Len() == 0 +} + // getThresholdsLabelText retrieves the custom thresholds label text if set, // otherwise returns the default value. func (p Plugin) getThresholdsLabelText() string { diff --git a/vendor/modules.txt b/vendor/modules.txt index 1b6b70e7..ae498966 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,4 +1,4 @@ -# github.com/atc0005/go-nagios v0.17.0-alpha.6 +# github.com/atc0005/go-nagios v0.17.0-alpha.7 ## explicit; go 1.19 github.com/atc0005/go-nagios # github.com/grantae/certinfo v0.0.0-20170412194111-59d56a35515b