From 401603f4be385e8f084284e2000e894d59c61944 Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Thu, 25 Jul 2024 17:16:02 +0000 Subject: [PATCH] chore: clear lint warnings Signed-off-by: Alejandro Mery --- cmd/jpictl/gateway.go | 6 +++--- pkg/cluster/ceph_scan.go | 5 +---- pkg/wireguard/config_parser.go | 2 -- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/cmd/jpictl/gateway.go b/cmd/jpictl/gateway.go index d093972..94683e0 100644 --- a/cmd/jpictl/gateway.go +++ b/cmd/jpictl/gateway.go @@ -43,7 +43,7 @@ func gatewaySet(zi cluster.ZoneIterator, gw string) error { zi.ForEachZone(func(z *cluster.Zone) bool { for _, m := range z.Machines { if m.Name == gw { - z.SetGateway(m.ID, true) + _ = z.SetGateway(m.ID, true) return true } } @@ -79,8 +79,8 @@ func gatewayUnset(zi cluster.ZoneIterator, ngw string) error { zi.ForEachZone(func(z *cluster.Zone) bool { for _, m := range z.Machines { if m.Name == ngw && m.IsGateway() { - z.SetGateway(m.ID, false) - m.RemoveWireguardConfig(0) + _ = z.SetGateway(m.ID, false) + _ = m.RemoveWireguardConfig(0) return true } } diff --git a/pkg/cluster/ceph_scan.go b/pkg/cluster/ceph_scan.go index 59e5edd..f9d1d97 100644 --- a/pkg/cluster/ceph_scan.go +++ b/pkg/cluster/ceph_scan.go @@ -73,10 +73,7 @@ func newCephScanTODO(cfg *ceph.Config) *cephScanTODO { func (m *Cluster) scanCephMonitors(opts *ScanOptions) error { cfg, err := m.GetCephConfig() - switch { - case os.IsNotExist(err): - err = nil - case err != nil: + if err != nil && !os.IsNotExist(err) { return err } diff --git a/pkg/wireguard/config_parser.go b/pkg/wireguard/config_parser.go index e07a78e..7a282d3 100644 --- a/pkg/wireguard/config_parser.go +++ b/pkg/wireguard/config_parser.go @@ -8,8 +8,6 @@ import ( "darvaza.org/core" ) -type sectionHandler func(*Config, *basic.Section) error - var sectionMap = map[string]func(*Config, *basic.Section) error{ "Interface": loadInterfaceConfSection, "Peer": loadPeerConfSection,