Skip to content

Commit

Permalink
chore: import formatting (#223)
Browse files Browse the repository at this point in the history
Applies import formatting.

Go's idiomatic conventions group imports into standard library imports, external (third-party) imports, and local (internal) imports.

Signed-off-by: Ryan Johnson <[email protected]>
  • Loading branch information
tenthirtyam authored Aug 20, 2024
1 parent 50bc5ad commit 94a68df
Show file tree
Hide file tree
Showing 78 changed files with 307 additions and 182 deletions.
3 changes: 2 additions & 1 deletion internal/api_client/cloud_builder_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ package api_client

import (
"crypto/tls"
"net/http"

openapiclient "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
vcfclient "github.com/vmware/vcf-sdk-go/client"
"net/http"
)

// CloudBuilderClient is an API client that can execute the APIs of the CloudBuilder appliance.
Expand Down
13 changes: 7 additions & 6 deletions internal/api_client/sddc_manager_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,21 @@ import (
"crypto/tls"
"errors"
"fmt"
"github.com/hashicorp/terraform-plugin-log/tflog"
"github.com/vmware/terraform-provider-vcf/internal/constants"
"github.com/vmware/vcf-sdk-go/client/tasks"
"github.com/vmware/vcf-sdk-go/client/tokens"
"github.com/vmware/vcf-sdk-go/models"
"golang.org/x/exp/slices"
"log"
"net/http"
"strings"
"time"

openapiclient "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"github.com/hashicorp/terraform-plugin-log/tflog"
vcfclient "github.com/vmware/vcf-sdk-go/client"
"github.com/vmware/vcf-sdk-go/client/tasks"
"github.com/vmware/vcf-sdk-go/client/tokens"
"github.com/vmware/vcf-sdk-go/models"
"golang.org/x/exp/slices"

"github.com/vmware/terraform-provider-vcf/internal/constants"
)

// SddcManagerClient model that represents properties to authenticate against VCF instance.
Expand Down
10 changes: 6 additions & 4 deletions internal/certificates/certificate_operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ package certificates

import (
"context"
"time"

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/vmware/terraform-provider-vcf/internal/api_client"
"github.com/vmware/terraform-provider-vcf/internal/constants"
validationutils "github.com/vmware/terraform-provider-vcf/internal/validation"
vcfclient "github.com/vmware/vcf-sdk-go/client"
"github.com/vmware/vcf-sdk-go/client/certificates"
"github.com/vmware/vcf-sdk-go/models"
"time"

"github.com/vmware/terraform-provider-vcf/internal/api_client"
"github.com/vmware/terraform-provider-vcf/internal/constants"
validationutils "github.com/vmware/terraform-provider-vcf/internal/validation"
)

func ValidateResourceCertificates(ctx context.Context, client *vcfclient.VcfClient,
Expand Down
14 changes: 8 additions & 6 deletions internal/cluster/cluster_operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@ package cluster
import (
"context"
"fmt"
"sort"

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/vmware/terraform-provider-vcf/internal/constants"
"github.com/vmware/terraform-provider-vcf/internal/datastores"
"github.com/vmware/terraform-provider-vcf/internal/network"
"github.com/vmware/terraform-provider-vcf/internal/resource_utils"
validationUtils "github.com/vmware/terraform-provider-vcf/internal/validation"
"github.com/vmware/vcf-sdk-go/client"
"github.com/vmware/vcf-sdk-go/client/clusters"
"github.com/vmware/vcf-sdk-go/client/domains"
"github.com/vmware/vcf-sdk-go/client/hosts"
"github.com/vmware/vcf-sdk-go/models"
"sort"

"github.com/vmware/terraform-provider-vcf/internal/constants"
"github.com/vmware/terraform-provider-vcf/internal/datastores"
"github.com/vmware/terraform-provider-vcf/internal/network"
"github.com/vmware/terraform-provider-vcf/internal/resource_utils"
validationUtils "github.com/vmware/terraform-provider-vcf/internal/validation"
)

func CreateClusterUpdateSpec(data *schema.ResourceData, markForDeletion bool) (*models.ClusterUpdateSpec, error) {
Expand Down
4 changes: 3 additions & 1 deletion internal/cluster/host_spec_subresource.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ package cluster

import (
"fmt"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
"github.com/vmware/vcf-sdk-go/models"

"github.com/vmware/terraform-provider-vcf/internal/network"
validationutils "github.com/vmware/terraform-provider-vcf/internal/validation"
"github.com/vmware/vcf-sdk-go/models"
)

// HostSpecSchema this helper function extracts the Host
Expand Down
3 changes: 2 additions & 1 deletion internal/credentials/credential_operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ import (

"github.com/go-openapi/strfmt"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/vmware/terraform-provider-vcf/internal/api_client"
"github.com/vmware/vcf-sdk-go/client"
"github.com/vmware/vcf-sdk-go/client/credentials"
"github.com/vmware/vcf-sdk-go/models"

"github.com/vmware/terraform-provider-vcf/internal/api_client"
)

func ReadCredentials(ctx context.Context, data *schema.ResourceData, apiClient *client.VcfClient) ([]*models.Credential, error) {
Expand Down
4 changes: 3 additions & 1 deletion internal/datastores/nfs_datastore_subresource.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ package datastores

import (
"fmt"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
validationutils "github.com/vmware/terraform-provider-vcf/internal/validation"
"github.com/vmware/vcf-sdk-go/models"

validationutils "github.com/vmware/terraform-provider-vcf/internal/validation"
)

// NfsDatastoreSchema this helper function extracts the NFS Datastore schema, so that
Expand Down
1 change: 1 addition & 0 deletions internal/datastores/vmfs_datastore_subresource.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package datastores

import (
"fmt"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/vmware/vcf-sdk-go/models"
)
Expand Down
4 changes: 3 additions & 1 deletion internal/datastores/vsan_datastore_subresource.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ package datastores

import (
"fmt"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
validationutils "github.com/vmware/terraform-provider-vcf/internal/validation"
"github.com/vmware/vcf-sdk-go/models"

validationutils "github.com/vmware/terraform-provider-vcf/internal/validation"
)

// VsanDatastoreSchema this helper function extracts the vSAN Datastore schema, so that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package datastores

import (
"fmt"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/vmware/vcf-sdk-go/models"
)
Expand Down
3 changes: 2 additions & 1 deletion internal/datastores/vvol_datastore_subresource.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ package datastores

import (
"fmt"
"strings"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
"github.com/vmware/vcf-sdk-go/models"
"strings"
)

// VvolDatastoreSchema this helper function extracts the VVOL Datastore schema, so that
Expand Down
12 changes: 7 additions & 5 deletions internal/domain/domain_operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@ package domain
import (
"context"
"fmt"
"sort"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/vmware/vcf-sdk-go/client"
"github.com/vmware/vcf-sdk-go/client/clusters"
"github.com/vmware/vcf-sdk-go/client/domains"
"github.com/vmware/vcf-sdk-go/models"

"github.com/vmware/terraform-provider-vcf/internal/cluster"
"github.com/vmware/terraform-provider-vcf/internal/constants"
"github.com/vmware/terraform-provider-vcf/internal/network"
validationUtils "github.com/vmware/terraform-provider-vcf/internal/validation"
"github.com/vmware/terraform-provider-vcf/internal/vcenter"
"github.com/vmware/vcf-sdk-go/client"
"github.com/vmware/vcf-sdk-go/client/clusters"
"github.com/vmware/vcf-sdk-go/client/domains"
"github.com/vmware/vcf-sdk-go/models"
"sort"
)

func CreateDomainCreationSpec(data *schema.ResourceData) (*models.DomainCreationSpec, error) {
Expand Down
4 changes: 3 additions & 1 deletion internal/network/ip_address_pool_subresource.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ package network

import (
"fmt"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
validationutils "github.com/vmware/terraform-provider-vcf/internal/validation"
"github.com/vmware/vcf-sdk-go/models"

validationutils "github.com/vmware/terraform-provider-vcf/internal/validation"
)

// IpAddressPoolSchema this helper function extracts the IpAddressPoolSpec schema, which
Expand Down
6 changes: 4 additions & 2 deletions internal/network/nioc_bandwidth_allocation_subresource.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ package network

import (
"fmt"
"strings"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
validationutils "github.com/vmware/terraform-provider-vcf/internal/validation"
"github.com/vmware/vcf-sdk-go/models"
"strings"

validationutils "github.com/vmware/terraform-provider-vcf/internal/validation"
)

// NiocBandwidthAllocationSchema this helper function extracts the NiocBandwidthAllocation
Expand Down
4 changes: 3 additions & 1 deletion internal/network/nsx_manager_subresource.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ package network

import (
"fmt"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
validationutils "github.com/vmware/terraform-provider-vcf/internal/validation"
"github.com/vmware/vcf-sdk-go/models"

validationutils "github.com/vmware/terraform-provider-vcf/internal/validation"
)

// NsxManagerNodeSchema this helper function extracts the NSX Manager Node schema, which contains
Expand Down
10 changes: 6 additions & 4 deletions internal/network/nsx_subresource.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ package network
import (
"context"
"fmt"
"sort"
"strings"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
"github.com/vmware/terraform-provider-vcf/internal/constants"
validationutils "github.com/vmware/terraform-provider-vcf/internal/validation"
"github.com/vmware/vcf-sdk-go/client"
"github.com/vmware/vcf-sdk-go/client/nsxt_clusters"
"github.com/vmware/vcf-sdk-go/models"
"sort"
"strings"

"github.com/vmware/terraform-provider-vcf/internal/constants"
validationutils "github.com/vmware/terraform-provider-vcf/internal/validation"
)

// NsxSchema this helper function extracts the NSX schema, which
Expand Down
6 changes: 4 additions & 2 deletions internal/network/portgroup_subresource.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ package network

import (
"fmt"
"strings"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
validationutils "github.com/vmware/terraform-provider-vcf/internal/validation"
"github.com/vmware/vcf-sdk-go/models"
"strings"

validationutils "github.com/vmware/terraform-provider-vcf/internal/validation"
)

// PortgroupSchema this helper function extracts the Portgroup Schema, so that
Expand Down
4 changes: 3 additions & 1 deletion internal/network/vds_subresource.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ package network

import (
"fmt"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
validationutils "github.com/vmware/terraform-provider-vcf/internal/validation"
"github.com/vmware/vcf-sdk-go/models"

validationutils "github.com/vmware/terraform-provider-vcf/internal/validation"
)

// VdsSchema this helper function extracts the VDS Schema, so that
Expand Down
4 changes: 3 additions & 1 deletion internal/network/vmnic_subresource.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ package network

import (
"fmt"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
validationutils "github.com/vmware/terraform-provider-vcf/internal/validation"
"github.com/vmware/vcf-sdk-go/models"

validationutils "github.com/vmware/terraform-provider-vcf/internal/validation"
)

// VMNicSchema this helper function extracts the VMNic Schema, so that
Expand Down
6 changes: 4 additions & 2 deletions internal/nsx_edge_cluster/edge_cluster_operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ package nsx_edge_cluster
import (
"errors"
"fmt"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/vmware/terraform-provider-vcf/internal/constants"
"github.com/vmware/terraform-provider-vcf/internal/resource_utils"
"github.com/vmware/vcf-sdk-go/client"
"github.com/vmware/vcf-sdk-go/client/clusters"
"github.com/vmware/vcf-sdk-go/models"

"github.com/vmware/terraform-provider-vcf/internal/constants"
"github.com/vmware/terraform-provider-vcf/internal/resource_utils"
)

const (
Expand Down
4 changes: 3 additions & 1 deletion internal/nsx_edge_cluster/edge_node_subresource.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
package nsx_edge_cluster

import (
"math"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"

validationUtils "github.com/vmware/terraform-provider-vcf/internal/validation"
"math"
)

func EdgeNodeSchema() *schema.Resource {
Expand Down
4 changes: 3 additions & 1 deletion internal/provider/data_credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ package provider

import (
"context"
"strconv"

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"

"github.com/vmware/terraform-provider-vcf/internal/api_client"
"github.com/vmware/terraform-provider-vcf/internal/credentials"
"strconv"
)

func DataSourceCredentials() *schema.Resource {
Expand Down
5 changes: 3 additions & 2 deletions internal/provider/data_credentials_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
package provider

import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)

func TestAccDataSourceCredentialsAll(t *testing.T) {
Expand Down Expand Up @@ -36,7 +37,7 @@ func TestAccDataSourceCredentials_VC(t *testing.T) {
func testAccDataSourceCredentialsAll() string {
return `
data "vcf_credentials" "creds" {
}
`
}
Expand Down
4 changes: 3 additions & 1 deletion internal/provider/data_source_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ package provider

import (
"context"
"time"

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"

"github.com/vmware/terraform-provider-vcf/internal/api_client"
"github.com/vmware/terraform-provider-vcf/internal/cluster"
"github.com/vmware/terraform-provider-vcf/internal/network"
"time"
)

func DataSourceCluster() *schema.Resource {
Expand Down
Loading

0 comments on commit 94a68df

Please sign in to comment.