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 Jun 14, 2024
1 parent ccb3d1a commit 8e0f84b
Show file tree
Hide file tree
Showing 4 changed files with 6 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 DataSourceOutscaleLoadBalancerLDRuleRead(d *schema.ResourceData, meta inter

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 DataSourceOutscaleLoadBalancerLDRulesRead(d *schema.ResourceData, meta inte

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
2 changes: 1 addition & 1 deletion outscale/resource_outscale_load_balancer_vms.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ 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] 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 8e0f84b

Please sign in to comment.