From 40130a59b39ab87f2caea2d4c9437c3661e3127f Mon Sep 17 00:00:00 2001 From: Matthew Christopher Date: Mon, 30 Sep 2024 13:46:18 -0700 Subject: [PATCH] Fix gofumpt formatting For some reason this isn't failing CI but it's constantly reformatting on my local --- Taskfile.yml | 1 + v2/cmd/asoctl/cmd/export_template.go | 7 +++---- v2/cmd/asoctl/cmd/import_azure_resource.go | 5 ++--- .../pkg/importresources/importable_arm_resource.go | 9 +++++---- v2/cmd/asoctl/pkg/importresources/importable_resource.go | 1 + 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index d03c709b49a..a5550a4bbc8 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -82,6 +82,7 @@ tasks: - task: controller:ci - task: crossplane:ci - task: asoctl:ci + - task: format-code - task: verify-no-changes ci-live: diff --git a/v2/cmd/asoctl/cmd/export_template.go b/v2/cmd/asoctl/cmd/export_template.go index 29ef07e0a3c..e0f377a327e 100644 --- a/v2/cmd/asoctl/cmd/export_template.go +++ b/v2/cmd/asoctl/cmd/export_template.go @@ -7,20 +7,19 @@ package cmd import ( "fmt" - "github.com/go-logr/logr" - "k8s.io/apimachinery/pkg/runtime/schema" "os" "reflect" "regexp" "strings" + "github.com/go-logr/logr" "github.com/pkg/errors" "github.com/spf13/cobra" - - . "github.com/Azure/azure-service-operator/v2/internal/logging" + "k8s.io/apimachinery/pkg/runtime/schema" "github.com/Azure/azure-service-operator/v2/api" "github.com/Azure/azure-service-operator/v2/cmd/asoctl/internal/template" + . "github.com/Azure/azure-service-operator/v2/internal/logging" "github.com/Azure/azure-service-operator/v2/internal/util/match" ) diff --git a/v2/cmd/asoctl/cmd/import_azure_resource.go b/v2/cmd/asoctl/cmd/import_azure_resource.go index 3a331872550..f7060398bd2 100644 --- a/v2/cmd/asoctl/cmd/import_azure_resource.go +++ b/v2/cmd/asoctl/cmd/import_azure_resource.go @@ -7,21 +7,20 @@ package cmd import ( "context" - "github.com/go-logr/logr" "io" "os" "sync" "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/go-logr/logr" "github.com/pkg/errors" "github.com/spf13/cobra" - internalconfig "github.com/Azure/azure-service-operator/v2/internal/config" - "github.com/Azure/azure-service-operator/v2/api" "github.com/Azure/azure-service-operator/v2/cmd/asoctl/pkg/importreporter" "github.com/Azure/azure-service-operator/v2/cmd/asoctl/pkg/importresources" + internalconfig "github.com/Azure/azure-service-operator/v2/internal/config" "github.com/Azure/azure-service-operator/v2/internal/genericarmclient" "github.com/Azure/azure-service-operator/v2/internal/version" "github.com/Azure/azure-service-operator/v2/pkg/common/config" diff --git a/v2/cmd/asoctl/pkg/importresources/importable_arm_resource.go b/v2/cmd/asoctl/pkg/importresources/importable_arm_resource.go index aac6a7431b6..8e66385b09e 100644 --- a/v2/cmd/asoctl/pkg/importresources/importable_arm_resource.go +++ b/v2/cmd/asoctl/pkg/importresources/importable_arm_resource.go @@ -8,7 +8,6 @@ package importresources import ( "context" "fmt" - "github.com/Azure/azure-service-operator/v2/cmd/asoctl/pkg/importreporter" "net/http" "reflect" "regexp" @@ -22,9 +21,9 @@ import ( "github.com/pkg/errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - kerrors "k8s.io/apimachinery/pkg/util/errors" + "github.com/Azure/azure-service-operator/v2/cmd/asoctl/pkg/importreporter" "github.com/Azure/azure-service-operator/v2/internal/controllers" "github.com/Azure/azure-service-operator/v2/internal/genericarmclient" "github.com/Azure/azure-service-operator/v2/internal/reflecthelpers" @@ -41,8 +40,10 @@ type importableARMResource struct { err error // Any error we encountered during import } -var _ ImportableResource = &importableARMResource{} -var _ ImportedResource = &importableARMResource{} +var ( + _ ImportableResource = &importableARMResource{} + _ ImportedResource = &importableARMResource{} +) // NewImportableARMResource creates a new importable ARM resource // id is the ARM ID of the resource to import. diff --git a/v2/cmd/asoctl/pkg/importresources/importable_resource.go b/v2/cmd/asoctl/pkg/importresources/importable_resource.go index 2d18a2f5c2d..c126f23d526 100644 --- a/v2/cmd/asoctl/pkg/importresources/importable_resource.go +++ b/v2/cmd/asoctl/pkg/importresources/importable_resource.go @@ -7,6 +7,7 @@ package importresources import ( "context" + "github.com/Azure/azure-service-operator/v2/cmd/asoctl/pkg/importreporter" "github.com/go-logr/logr"