1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 05:40:11 +01:00

Fixed linting errors

This commit is contained in:
Christian Banse 2024-04-19 09:35:36 +02:00
parent e658738b56
commit fb1cf32e17
2 changed files with 4 additions and 3 deletions

View file

@ -396,7 +396,7 @@ func (c *config) setDefaults() {
}
// prepareLogging sets up the structured logging.
func (cfg *config) prepareLogging() error {
func (c *config) prepareLogging() error {
ho := slog.HandlerOptions{
Level: slog.LevelDebug,
}

View file

@ -149,8 +149,9 @@ func ErrorCheck(err error) {
}
}
// ErrorCheck checks if err is not nil and terminates
// the program if so.
// ErrorCheckStructured checks if err is not nil and terminates the program if
// so. This is similar to [ErrorCheck], but uses [slog] instead of the
// non-structured Go logging.
func ErrorCheckStructured(err error) {
if err != nil {
slog.Error("Error while executing program", "err", err)