Skip to content

Commit

Permalink
Add vet code checking
Browse files Browse the repository at this point in the history
  • Loading branch information
outscale-toa committed Mar 28, 2024
1 parent d4b471e commit adaa54f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
6 changes: 5 additions & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions outscale/data_source_outscale_load_balancer_listener_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
4 changes: 0 additions & 4 deletions outscale/data_source_outscale_load_balancer_listener_rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
1 change: 0 additions & 1 deletion outscale/resource_outscale_load_balancer_vms.go
Original file line number Diff line number Diff line change
Expand Up @@ -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("")
Expand Down

0 comments on commit adaa54f

Please sign in to comment.