From 8a8209dbf062f515777cc21c69d2fff64cbc458a Mon Sep 17 00:00:00 2001 From: Markus Blaschke Date: Sun, 16 Aug 2020 22:44:59 +0200 Subject: [PATCH] go fmt Signed-off-by: Markus Blaschke --- collector_base.go | 2 +- config/opts.go | 12 ++++++------ main.go | 7 ++++--- metrics_keyvault.go | 3 +-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/collector_base.go b/collector_base.go index 802b0a4..30d814a 100644 --- a/collector_base.go +++ b/collector_base.go @@ -2,8 +2,8 @@ package main import ( "github.com/Azure/azure-sdk-for-go/profiles/latest/resources/mgmt/subscriptions" - "time" log "github.com/sirupsen/logrus" + "time" ) type CollectorBase struct { diff --git a/config/opts.go b/config/opts.go index e59e7b6..285f5b9 100644 --- a/config/opts.go +++ b/config/opts.go @@ -17,16 +17,16 @@ type ( // azure Azure struct { - Environment *string `long:"azure.environment" env:"AZURE_ENVIRONMENT" description:"Azure environment name" default:"AZUREPUBLICCLOUD"` - Subscription []string `long:"azure.subscription" env:"AZURE_SUBSCRIPTION_ID" env-delim:" " description:"Azure subscription ID"` - Location []string `long:"azure.location" env:"AZURE_LOCATION" env-delim:" " description:"Azure locations" default:"westeurope" default:"northeurope"` - ResourceGroup string `long:"azure.resourcegroup" env:"AZURE_RESOURCEGROUP" description:"Azure ResourceGroup"` - ResourceTags []string `long:"azure.resource-tag" env:"AZURE_RESOURCE_TAG" env-delim:" " description:"Azure Resource tags" default:"owner"` + Environment *string `long:"azure.environment" env:"AZURE_ENVIRONMENT" description:"Azure environment name" default:"AZUREPUBLICCLOUD"` + Subscription []string `long:"azure.subscription" env:"AZURE_SUBSCRIPTION_ID" env-delim:" " description:"Azure subscription ID"` + Location []string `long:"azure.location" env:"AZURE_LOCATION" env-delim:" " description:"Azure locations" default:"westeurope" default:"northeurope"` + ResourceGroup string `long:"azure.resourcegroup" env:"AZURE_RESOURCEGROUP" description:"Azure ResourceGroup"` + ResourceTags []string `long:"azure.resource-tag" env:"AZURE_RESOURCE_TAG" env-delim:" " description:"Azure Resource tags" default:"owner"` } // scrape times Scrape struct { - Time time.Duration `long:"scrape.time" env:"SCRAPE_TIME" description:"Default scrape time (time.duration)" default:"5m"` + Time time.Duration `long:"scrape.time" env:"SCRAPE_TIME" description:"Default scrape time (time.duration)" default:"5m"` } // general options diff --git a/main.go b/main.go index 75d8bfd..7fae98f 100644 --- a/main.go +++ b/main.go @@ -9,8 +9,8 @@ import ( "github.com/Azure/go-autorest/autorest/azure/auth" "github.com/jessevdk/go-flags" "github.com/prometheus/client_golang/prometheus/promhttp" - "github.com/webdevops/azure-keyvault-exporter/config" log "github.com/sirupsen/logrus" + "github.com/webdevops/azure-keyvault-exporter/config" "net/http" "os" "path" @@ -30,8 +30,8 @@ var ( AzureAuthorizer autorest.Authorizer AzureSubscriptions []subscriptions.Subscription - azureKeyvaultTag AzureTagFilter - azureEnvironment azure.Environment + azureKeyvaultTag AzureTagFilter + azureEnvironment azure.Environment collectorGeneralList map[string]*CollectorGeneral @@ -39,6 +39,7 @@ var ( gitCommit = "" gitTag = "" ) + func main() { initArgparser() diff --git a/metrics_keyvault.go b/metrics_keyvault.go index 4afa596..18041f5 100644 --- a/metrics_keyvault.go +++ b/metrics_keyvault.go @@ -10,9 +10,9 @@ import ( "github.com/Azure/go-autorest/autorest/azure/auth" "github.com/prometheus/client_golang/prometheus" log "github.com/sirupsen/logrus" + prometheusCommon "github.com/webdevops/go-prometheus-common" "sync" "time" - prometheusCommon "github.com/webdevops/go-prometheus-common" ) type MetricsCollectorKeyvault struct { @@ -353,7 +353,6 @@ func (m *MetricsCollectorKeyvault) collectKeyvault(ctx context.Context, logger * }, 1) } - for secretsResult.NotDone() { item := secretsResult.Value()