From adaa54f6dc9495dc0b9c77621973a5f63f4cb56b Mon Sep 17 00:00:00 2001 From: Thiery Ouattara Date: Thu, 28 Mar 2024 14:57:55 +0000 Subject: [PATCH] Add vet code checking --- GNUmakefile | 6 +++++- .../data_source_outscale_load_balancer_listener_rule.go | 4 ---- .../data_source_outscale_load_balancer_listener_rules.go | 4 ---- outscale/resource_outscale_load_balancer_vms.go | 1 - 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 968a5e7bd..26ae4bba2 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -17,8 +17,12 @@ build: fmtcheck fmtcheck: @sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'" +.PHONY: vet +vet: fmtcheck + go vet $(TEST) + .PHONY: test -test: fmtcheck +test: fmtcheck vet go test $(TEST) -count 1 -timeout=30s -parallel=4 .PHONY: testacc diff --git a/outscale/data_source_outscale_load_balancer_listener_rule.go b/outscale/data_source_outscale_load_balancer_listener_rule.go index 72e79f2a8..612eb2887 100644 --- a/outscale/data_source_outscale_load_balancer_listener_rule.go +++ b/outscale/data_source_outscale_load_balancer_listener_rule.go @@ -148,14 +148,10 @@ func dataSourceOutscaleOAPILoadBalancerLDRuleRead(d *schema.ResourceData, meta i if lr.Priority != nil { d.Set("priority", lr.Priority) - } else { - fmt.Errorf("Malformated listener rule") } if lr.VmIds != nil { d.Set("vm_ids", utils.StringSlicePtrToInterfaceSlice(lr.VmIds)) - } else { - fmt.Errorf("Malformated listener rule") } d.SetId(resource.UniqueId()) diff --git a/outscale/data_source_outscale_load_balancer_listener_rules.go b/outscale/data_source_outscale_load_balancer_listener_rules.go index d14ce14bd..ca2162331 100644 --- a/outscale/data_source_outscale_load_balancer_listener_rules.go +++ b/outscale/data_source_outscale_load_balancer_listener_rules.go @@ -161,14 +161,10 @@ func dataSourceOutscaleOAPILoadBalancerLDRulesRead(d *schema.ResourceData, meta if lr.Priority != nil { l["priority"] = lr.Priority - } else { - fmt.Errorf("Malformated listener rule") } if lr.VmIds != nil { l["vm_ids"] = utils.StringSlicePtrToInterfaceSlice(lr.VmIds) - } else { - fmt.Errorf("Malformated listener rule") } lrs_ret[k] = l } diff --git a/outscale/resource_outscale_load_balancer_vms.go b/outscale/resource_outscale_load_balancer_vms.go index c984328e4..bf7a014aa 100644 --- a/outscale/resource_outscale_load_balancer_vms.go +++ b/outscale/resource_outscale_load_balancer_vms.go @@ -90,7 +90,6 @@ func resourceLBUAttachmentRead(d *schema.ResourceData, meta interface{}) error { if managed.Len() == 0 { log.Printf("[WARN] not expected attachments found in LBU %s", lbuName) - log.Printf("[WARN] lbu current attachments are %#v", all_backends) log.Printf("[WARN] we would manage only these attachments %#v", expected) log.Printf("[WARN] no managed attachments are present.") d.SetId("")