diff --git a/.golangci.yml b/.golangci.yml index dcd832b..ce951f3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -8,6 +8,7 @@ linters: enable: - godot - gofmt + - goimports - misspell - whitespace - gci @@ -16,3 +17,6 @@ linters-settings: sections: - standard - default + - prefix(github.com/lxc/terraform-provider-incus) + goimports: + local-prefixes: github.com/lxc/terraform-provider-incus diff --git a/internal/clustering/resource_cluster_group.go b/internal/clustering/resource_cluster_group.go index 4183c9d..87b2bc1 100644 --- a/internal/clustering/resource_cluster_group.go +++ b/internal/clustering/resource_cluster_group.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/lxc/incus/v6/client" + incus "github.com/lxc/incus/v6/client" "github.com/lxc/incus/v6/shared/api" "github.com/lxc/terraform-provider-incus/internal/common" diff --git a/internal/clustering/resource_cluster_group_assignment.go b/internal/clustering/resource_cluster_group_assignment.go index 3cec6c1..ed6f692 100644 --- a/internal/clustering/resource_cluster_group_assignment.go +++ b/internal/clustering/resource_cluster_group_assignment.go @@ -3,6 +3,7 @@ package clustering import ( "context" "fmt" + "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" @@ -11,8 +12,9 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/lxc/incus/v6/client" + incus "github.com/lxc/incus/v6/client" "github.com/lxc/incus/v6/shared/api" + "github.com/lxc/terraform-provider-incus/internal/common" "github.com/lxc/terraform-provider-incus/internal/errors" provider_config "github.com/lxc/terraform-provider-incus/internal/provider-config" diff --git a/internal/common/incus_file.go b/internal/common/incus_file.go index 13c0ee3..03d9a04 100644 --- a/internal/common/incus_file.go +++ b/internal/common/incus_file.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/lxc/incus/v6/client" + incus "github.com/lxc/incus/v6/client" "github.com/mitchellh/go-homedir" "github.com/lxc/terraform-provider-incus/internal/errors" diff --git a/internal/config/resource_certificate.go b/internal/config/resource_certificate.go index 6e40429..1ef1040 100644 --- a/internal/config/resource_certificate.go +++ b/internal/config/resource_certificate.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/lxc/incus/v6/client" + incus "github.com/lxc/incus/v6/client" "github.com/lxc/incus/v6/shared/api" localtls "github.com/lxc/incus/v6/shared/tls" diff --git a/internal/image/datasource_image.go b/internal/image/datasource_image.go index 8ef7909..8cc925d 100644 --- a/internal/image/datasource_image.go +++ b/internal/image/datasource_image.go @@ -10,8 +10,8 @@ import ( "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/lxc/incus/v6/shared/api" + "github.com/lxc/terraform-provider-incus/internal/errors" provider_config "github.com/lxc/terraform-provider-incus/internal/provider-config" ) diff --git a/internal/image/resource_image.go b/internal/image/resource_image.go index c65c413..282ab6b 100644 --- a/internal/image/resource_image.go +++ b/internal/image/resource_image.go @@ -23,7 +23,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" - "github.com/lxc/incus/v6/client" + incus "github.com/lxc/incus/v6/client" "github.com/lxc/incus/v6/shared/api" "github.com/lxc/terraform-provider-incus/internal/errors" diff --git a/internal/image/resource_image_test.go b/internal/image/resource_image_test.go index f659e61..70eceb5 100644 --- a/internal/image/resource_image_test.go +++ b/internal/image/resource_image_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/dustinkirkland/golang-petname" + petname "github.com/dustinkirkland/golang-petname" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/lxc/terraform-provider-incus/internal/acctest" diff --git a/internal/image/schema_validators.go b/internal/image/schema_validators.go index 90f325c..ea534ba 100644 --- a/internal/image/schema_validators.go +++ b/internal/image/schema_validators.go @@ -6,7 +6,6 @@ import ( "strings" "github.com/hashicorp/terraform-plugin-framework/schema/validator" - "github.com/lxc/incus/v6/shared/osarch" ) diff --git a/internal/instance/resource_instance.go b/internal/instance/resource_instance.go index 33e9ce3..0647146 100644 --- a/internal/instance/resource_instance.go +++ b/internal/instance/resource_instance.go @@ -27,14 +27,13 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/lxc/incus/v6/client" + incus "github.com/lxc/incus/v6/client" "github.com/lxc/incus/v6/shared/api" "github.com/lxc/terraform-provider-incus/internal/common" "github.com/lxc/terraform-provider-incus/internal/errors" - "github.com/lxc/terraform-provider-incus/internal/utils" - provider_config "github.com/lxc/terraform-provider-incus/internal/provider-config" + "github.com/lxc/terraform-provider-incus/internal/utils" ) type InstanceModel struct { diff --git a/internal/instance/resource_instance_snapshot.go b/internal/instance/resource_instance_snapshot.go index 7381c1a..5961d38 100644 --- a/internal/instance/resource_instance_snapshot.go +++ b/internal/instance/resource_instance_snapshot.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/lxc/incus/v6/client" + incus "github.com/lxc/incus/v6/client" "github.com/lxc/incus/v6/shared/api" "github.com/lxc/terraform-provider-incus/internal/errors" diff --git a/internal/instance/resource_instance_snapshot_test.go b/internal/instance/resource_instance_snapshot_test.go index 5c330f9..4f7d403 100644 --- a/internal/instance/resource_instance_snapshot_test.go +++ b/internal/instance/resource_instance_snapshot_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/dustinkirkland/golang-petname" + petname "github.com/dustinkirkland/golang-petname" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/lxc/terraform-provider-incus/internal/acctest" diff --git a/internal/instance/resource_instance_test.go b/internal/instance/resource_instance_test.go index 11ca373..d80dd9b 100644 --- a/internal/instance/resource_instance_test.go +++ b/internal/instance/resource_instance_test.go @@ -5,7 +5,7 @@ import ( "regexp" "testing" - "github.com/dustinkirkland/golang-petname" + petname "github.com/dustinkirkland/golang-petname" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/lxc/terraform-provider-incus/internal/acctest" diff --git a/internal/instance/schema_validators.go b/internal/instance/schema_validators.go index 5dbaedb..d356c1c 100644 --- a/internal/instance/schema_validators.go +++ b/internal/instance/schema_validators.go @@ -3,6 +3,7 @@ package instance import ( "context" "fmt" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/lxc/terraform-provider-incus/internal/utils" diff --git a/internal/network/resource_network.go b/internal/network/resource_network.go index 965749e..d6b933e 100644 --- a/internal/network/resource_network.go +++ b/internal/network/resource_network.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/lxc/incus/v6/client" + incus "github.com/lxc/incus/v6/client" "github.com/lxc/incus/v6/shared/api" "github.com/lxc/terraform-provider-incus/internal/common" diff --git a/internal/network/resource_network_acl.go b/internal/network/resource_network_acl.go index 0d14151..d595713 100644 --- a/internal/network/resource_network_acl.go +++ b/internal/network/resource_network_acl.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/lxc/incus/v6/client" + incus "github.com/lxc/incus/v6/client" "github.com/lxc/incus/v6/shared/api" "github.com/lxc/terraform-provider-incus/internal/common" diff --git a/internal/network/resource_network_acl_test.go b/internal/network/resource_network_acl_test.go index 371a501..e606b12 100644 --- a/internal/network/resource_network_acl_test.go +++ b/internal/network/resource_network_acl_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/dustinkirkland/golang-petname" + petname "github.com/dustinkirkland/golang-petname" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/lxc/terraform-provider-incus/internal/acctest" diff --git a/internal/network/resource_network_forward.go b/internal/network/resource_network_forward.go index 9bc96ef..8348416 100644 --- a/internal/network/resource_network_forward.go +++ b/internal/network/resource_network_forward.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/lxc/incus/v6/client" + incus "github.com/lxc/incus/v6/client" "github.com/lxc/incus/v6/shared/api" "github.com/lxc/terraform-provider-incus/internal/common" diff --git a/internal/network/resource_network_forward_test.go b/internal/network/resource_network_forward_test.go index 2172f10..e365a41 100644 --- a/internal/network/resource_network_forward_test.go +++ b/internal/network/resource_network_forward_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/dustinkirkland/golang-petname" + petname "github.com/dustinkirkland/golang-petname" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/lxc/terraform-provider-incus/internal/acctest" diff --git a/internal/network/resource_network_lb.go b/internal/network/resource_network_lb.go index 3ed029a..d42bd15 100644 --- a/internal/network/resource_network_lb.go +++ b/internal/network/resource_network_lb.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/lxc/incus/v6/client" + incus "github.com/lxc/incus/v6/client" "github.com/lxc/incus/v6/shared/api" "github.com/lxc/terraform-provider-incus/internal/common" diff --git a/internal/network/resource_network_lb_test.go b/internal/network/resource_network_lb_test.go index c39f1d8..b374cb9 100644 --- a/internal/network/resource_network_lb_test.go +++ b/internal/network/resource_network_lb_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/dustinkirkland/golang-petname" + petname "github.com/dustinkirkland/golang-petname" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/lxc/incus/v6/shared/api" diff --git a/internal/network/resource_network_test.go b/internal/network/resource_network_test.go index 3403338..538e9fa 100644 --- a/internal/network/resource_network_test.go +++ b/internal/network/resource_network_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/dustinkirkland/golang-petname" + petname "github.com/dustinkirkland/golang-petname" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/lxc/terraform-provider-incus/internal/acctest" diff --git a/internal/network/resource_network_zone.go b/internal/network/resource_network_zone.go index fbada2f..55091ee 100644 --- a/internal/network/resource_network_zone.go +++ b/internal/network/resource_network_zone.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/lxc/incus/v6/client" + incus "github.com/lxc/incus/v6/client" "github.com/lxc/incus/v6/shared/api" "github.com/lxc/terraform-provider-incus/internal/common" diff --git a/internal/network/resource_network_zone_record.go b/internal/network/resource_network_zone_record.go index 2cdda63..e19b454 100644 --- a/internal/network/resource_network_zone_record.go +++ b/internal/network/resource_network_zone_record.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/lxc/incus/v6/client" + incus "github.com/lxc/incus/v6/client" "github.com/lxc/incus/v6/shared/api" "github.com/lxc/terraform-provider-incus/internal/common" diff --git a/internal/network/resource_network_zone_record_test.go b/internal/network/resource_network_zone_record_test.go index d1f6c8b..3ce0c1e 100644 --- a/internal/network/resource_network_zone_record_test.go +++ b/internal/network/resource_network_zone_record_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/dustinkirkland/golang-petname" + petname "github.com/dustinkirkland/golang-petname" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/lxc/terraform-provider-incus/internal/acctest" diff --git a/internal/network/resource_network_zone_test.go b/internal/network/resource_network_zone_test.go index 1964c52..7779296 100644 --- a/internal/network/resource_network_zone_test.go +++ b/internal/network/resource_network_zone_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/dustinkirkland/golang-petname" + petname "github.com/dustinkirkland/golang-petname" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/lxc/terraform-provider-incus/internal/acctest" diff --git a/internal/profile/resource_profile.go b/internal/profile/resource_profile.go index 0415271..3d25d4b 100644 --- a/internal/profile/resource_profile.go +++ b/internal/profile/resource_profile.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/lxc/incus/v6/client" + incus "github.com/lxc/incus/v6/client" "github.com/lxc/incus/v6/shared/api" "github.com/lxc/terraform-provider-incus/internal/common" diff --git a/internal/profile/resource_profile_test.go b/internal/profile/resource_profile_test.go index 65fb6bf..10acc9f 100644 --- a/internal/profile/resource_profile_test.go +++ b/internal/profile/resource_profile_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/dustinkirkland/golang-petname" + petname "github.com/dustinkirkland/golang-petname" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/lxc/terraform-provider-incus/internal/acctest" diff --git a/internal/project/resource_project.go b/internal/project/resource_project.go index 08946a7..75614ee 100644 --- a/internal/project/resource_project.go +++ b/internal/project/resource_project.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/lxc/incus/v6/client" + incus "github.com/lxc/incus/v6/client" "github.com/lxc/incus/v6/shared/api" "github.com/lxc/terraform-provider-incus/internal/common" diff --git a/internal/project/resource_project_test.go b/internal/project/resource_project_test.go index 96ee818..26de7c4 100644 --- a/internal/project/resource_project_test.go +++ b/internal/project/resource_project_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/dustinkirkland/golang-petname" + petname "github.com/dustinkirkland/golang-petname" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/lxc/terraform-provider-incus/internal/acctest" diff --git a/internal/provider-config/config.go b/internal/provider-config/config.go index 1293013..7d9fc8c 100644 --- a/internal/provider-config/config.go +++ b/internal/provider-config/config.go @@ -7,7 +7,7 @@ import ( "path/filepath" "sync" - "github.com/lxc/incus/v6/client" + incus "github.com/lxc/incus/v6/client" incus_api "github.com/lxc/incus/v6/shared/api" incus_config "github.com/lxc/incus/v6/shared/cliconfig" incus_tls "github.com/lxc/incus/v6/shared/tls" diff --git a/internal/storage/resource_storage_bucket.go b/internal/storage/resource_storage_bucket.go index 1322f5a..29cd440 100644 --- a/internal/storage/resource_storage_bucket.go +++ b/internal/storage/resource_storage_bucket.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/lxc/incus/v6/client" + incus "github.com/lxc/incus/v6/client" "github.com/lxc/incus/v6/shared/api" "github.com/lxc/terraform-provider-incus/internal/common" diff --git a/internal/storage/resource_storage_bucket_key.go b/internal/storage/resource_storage_bucket_key.go index e918a2d..7a20ec1 100644 --- a/internal/storage/resource_storage_bucket_key.go +++ b/internal/storage/resource_storage_bucket_key.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/lxc/incus/v6/client" + incus "github.com/lxc/incus/v6/client" "github.com/lxc/incus/v6/shared/api" "github.com/lxc/terraform-provider-incus/internal/common" diff --git a/internal/storage/resource_storage_bucket_key_test.go b/internal/storage/resource_storage_bucket_key_test.go index 29fe475..12d43f5 100644 --- a/internal/storage/resource_storage_bucket_key_test.go +++ b/internal/storage/resource_storage_bucket_key_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/dustinkirkland/golang-petname" + petname "github.com/dustinkirkland/golang-petname" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" diff --git a/internal/storage/resource_storage_bucket_test.go b/internal/storage/resource_storage_bucket_test.go index 9dfa52b..614fed4 100644 --- a/internal/storage/resource_storage_bucket_test.go +++ b/internal/storage/resource_storage_bucket_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/dustinkirkland/golang-petname" + petname "github.com/dustinkirkland/golang-petname" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/lxc/terraform-provider-incus/internal/acctest" diff --git a/internal/storage/resource_storage_pool.go b/internal/storage/resource_storage_pool.go index e43010a..e13f102 100644 --- a/internal/storage/resource_storage_pool.go +++ b/internal/storage/resource_storage_pool.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/lxc/incus/v6/client" + incus "github.com/lxc/incus/v6/client" "github.com/lxc/incus/v6/shared/api" "github.com/lxc/terraform-provider-incus/internal/common" diff --git a/internal/storage/resource_storage_pool_test.go b/internal/storage/resource_storage_pool_test.go index d9d6f01..f349939 100644 --- a/internal/storage/resource_storage_pool_test.go +++ b/internal/storage/resource_storage_pool_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/dustinkirkland/golang-petname" + petname "github.com/dustinkirkland/golang-petname" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/lxc/terraform-provider-incus/internal/acctest" diff --git a/internal/storage/resource_storage_volume.go b/internal/storage/resource_storage_volume.go index c9e3a71..3ad4a49 100644 --- a/internal/storage/resource_storage_volume.go +++ b/internal/storage/resource_storage_volume.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" - "github.com/lxc/incus/v6/client" + incus "github.com/lxc/incus/v6/client" "github.com/lxc/incus/v6/shared/api" "github.com/lxc/terraform-provider-incus/internal/common" diff --git a/internal/storage/resource_storage_volume_test.go b/internal/storage/resource_storage_volume_test.go index 8925181..f249b48 100644 --- a/internal/storage/resource_storage_volume_test.go +++ b/internal/storage/resource_storage_volume_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/dustinkirkland/golang-petname" + petname "github.com/dustinkirkland/golang-petname" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/plancheck"