From 9b9d71d64877a09d8410cdbd824a3d501c13dfe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Wed, 6 Nov 2024 15:09:49 +0100 Subject: [PATCH] Fix linter warnings --- main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 4cc22e2..8003338 100644 --- a/main.go +++ b/main.go @@ -33,7 +33,7 @@ import ( var version = "dev" -var MAX_NTFY_ACTIONS = 3 +var maxNTFYActions = 3 type bridge struct { cfg *config.Config @@ -362,18 +362,18 @@ func (br *bridge) publish(n *notification) error { } nActions := len(actions) - if nActions > MAX_NTFY_ACTIONS { - br.logger.Warn(fmt.Sprintf("Publish: Too many actions (%d), ntfy only supports up to %d - removing surplus actions.", nActions, MAX_NTFY_ACTIONS)) + if nActions > maxNTFYActions { + br.logger.Warn(fmt.Sprintf("Publish: Too many actions (%d), ntfy only supports up to %d - removing surplus actions.", nActions, maxNTFYActions)) br.logger.Debug("Action list", slog.Any("actions", actions)) - actions = actions[:MAX_NTFY_ACTIONS] + actions = actions[:maxNTFYActions] } req.Header.Set("Actions", strings.Join(actions, ";")) configFingerprint := br.cfg.Ntfy.CertFingerprint if configFingerprint != "" { tlsCfg := &tls.Config{} - tlsCfg.VerifyPeerCertificate = func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error { + tlsCfg.VerifyPeerCertificate = func(rawCerts [][]byte, _ [][]*x509.Certificate) error { for _, rawCert := range rawCerts { hash := sha512.Sum512(rawCert) if hex.EncodeToString(hash[:]) == configFingerprint {