From 25db3015f85acdd832f3d8224f464ddb73e48de4 Mon Sep 17 00:00:00 2001 From: Stanley Zhang Date: Wed, 23 Oct 2024 09:17:46 +1300 Subject: [PATCH] revert main.go and fix linting for unused variable --- main.go | 15 ++------------- .../resource_postgresql_security_label_test.go | 3 +++ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/main.go b/main.go index 66aeb6ea..7125ff2f 100644 --- a/main.go +++ b/main.go @@ -1,22 +1,11 @@ package main import ( - "flag" - "github.com/hashicorp/terraform-plugin-sdk/v2/plugin" "github.com/terraform-providers/terraform-provider-postgresql/postgresql" ) func main() { - var debug bool - - flag.BoolVar(&debug, "debug", false, "set to true to run the provider with support for debuggers like delve") - flag.Parse() - - opts := &plugin.ServeOpts{ - Debug: debug, - ProviderFunc: postgresql.Provider, - ProviderAddr: "registry.terraform.io/cyrilgdn/postgresql", - } - plugin.Serve(opts) + plugin.Serve(&plugin.ServeOpts{ + ProviderFunc: postgresql.Provider}) } diff --git a/postgresql/resource_postgresql_security_label_test.go b/postgresql/resource_postgresql_security_label_test.go index d1f97be8..f1701795 100644 --- a/postgresql/resource_postgresql_security_label_test.go +++ b/postgresql/resource_postgresql_security_label_test.go @@ -146,6 +146,9 @@ func testAccCheckPostgresqlSecurityLabelExists(n string) resource.TestCheckFunc } provider, ok := rs.Primary.Attributes[securityLabelProviderAttr] + if !ok { + return fmt.Errorf("No Attribute for security provider is set") + } client := testAccProvider.Meta().(*Client) txn, err := startTransaction(client, "")