atc0005 / go-nagios

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

Fix errcheck linting errors #248

Closed atc0005 closed 4 months ago

atc0005 commented 4 months ago

Resolve `return value of fmt.Fprintf is not checked`` errors by explicitly discarding return values (potential error, bytes written) since we do not need them and the potential for failure (in this particular use case) is highly unlikely.

The one exception is Plugin.emitOutput. There, we capture the potential error and emit a message to os.Stderr if an error occurs. If that attempt fails (however unlikely) we panic.