Skip to content

Commit

Permalink
Enable go vet -unusedresult check and fix warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
tpounds authored and jen20 committed Feb 17, 2016
1 parent 79742fc commit 3eb65f2
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TEST?=$$(GO15VENDOREXPERIMENT=1 go list ./... | grep -v /vendor/)
VETARGS?=-asmdecl -atomic -bool -buildtags -composites -copylocks -methods -nilfunc -printf -rangeloops -shift -structtags -unsafeptr
VETARGS?=-asmdecl -atomic -bool -buildtags -composites -copylocks -methods -nilfunc -printf -rangeloops -shift -structtags -unsafeptr -unusedresult

default: test

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func testAccCheckAzureSqlDatabaseServerDeleted(s *terraform.State) error {

for _, srv := range servers.DatabaseServers {
if srv.Name == resource.Primary.ID {
fmt.Errorf("SQL Server %s still exists.", resource.Primary.ID)
return fmt.Errorf("SQL Server %s still exists.", resource.Primary.ID)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func testAccCheckAzureSqlDatabaseServiceDeleted(s *terraform.State) error {

for _, srv := range dbs.ServiceResources {
if srv.Name == resource.Primary.ID {
fmt.Errorf("SQL Service %s still exists.", resource.Primary.ID)
return fmt.Errorf("SQL Service %s still exists.", resource.Primary.ID)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func testAccCheckDigitalOceanFloatingIPDestroy(s *terraform.State) error {
_, _, err := client.FloatingIPs.Get(rs.Primary.ID)

if err == nil {
fmt.Errorf("Floating IP still exists")
return fmt.Errorf("Floating IP still exists")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func testAccCheckDigitalOceanSSHKeyDestroy(s *terraform.State) error {
_, _, err = client.Keys.GetByID(id)

if err == nil {
fmt.Errorf("SSH key still exists")
return fmt.Errorf("SSH key still exists")
}
}

Expand Down
4 changes: 2 additions & 2 deletions builtin/providers/google/resource_pubsub_subscription_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func testAccCheckPubsubSubscriptionDestroy(s *terraform.State) error {
config := testAccProvider.Meta().(*Config)
_, err := config.clientPubsub.Projects.Subscriptions.Get(rs.Primary.ID).Do()
if err != nil {
fmt.Errorf("Subscription still present")
return fmt.Errorf("Subscription still present")
}
}

Expand All @@ -56,7 +56,7 @@ func testAccPubsubSubscriptionExists(n string) resource.TestCheckFunc {
config := testAccProvider.Meta().(*Config)
_, err := config.clientPubsub.Projects.Subscriptions.Get(rs.Primary.ID).Do()
if err != nil {
fmt.Errorf("Subscription still present")
return fmt.Errorf("Subscription still present")
}

return nil
Expand Down
4 changes: 2 additions & 2 deletions builtin/providers/google/resource_pubsub_topic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func testAccCheckPubsubTopicDestroy(s *terraform.State) error {
config := testAccProvider.Meta().(*Config)
_, err := config.clientPubsub.Projects.Topics.Get(rs.Primary.ID).Do()
if err != nil {
fmt.Errorf("Topic still present")
return fmt.Errorf("Topic still present")
}
}

Expand All @@ -56,7 +56,7 @@ func testAccPubsubTopicExists(n string) resource.TestCheckFunc {
config := testAccProvider.Meta().(*Config)
_, err := config.clientPubsub.Projects.Topics.Get(rs.Primary.ID).Do()
if err != nil {
fmt.Errorf("Topic still present")
return fmt.Errorf("Topic still present")
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion builtin/providers/tls/resource_cert_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func CreateCertRequest(d *schema.ResourceData, meta interface{}) error {

certReqBytes, err := x509.CreateCertificateRequest(rand.Reader, &certReq, key)
if err != nil {
fmt.Errorf("Error creating certificate request: %s", err)
return fmt.Errorf("Error creating certificate request: %s", err)
}
certReqPem := string(pem.EncodeToMemory(&pem.Block{Type: pemCertReqType, Bytes: certReqBytes}))

Expand Down
2 changes: 1 addition & 1 deletion builtin/providers/tls/resource_certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func createCertificate(d *schema.ResourceData, template, parent *x509.Certificat

certBytes, err := x509.CreateCertificate(rand.Reader, template, parent, pub, priv)
if err != nil {
fmt.Errorf("error creating certificate: %s", err)
return fmt.Errorf("error creating certificate: %s", err)
}
certPem := string(pem.EncodeToMemory(&pem.Block{Type: pemCertType, Bytes: certBytes}))

Expand Down

0 comments on commit 3eb65f2

Please sign in to comment.