From 134be0461da9ea87a2d9098649e64e3d0f060e75 Mon Sep 17 00:00:00 2001 From: bennerv <10840174+bennerv@users.noreply.github.com> Date: Mon, 6 May 2024 19:24:59 -0500 Subject: [PATCH] Enable goimports linter --- .golangci.yml | 4 ++++ frontend/frontend.go | 3 ++- frontend/metrics.go | 2 +- frontend/middleware_logging_test.go | 3 ++- internal/api/registry.go | 3 ++- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 5794826c3..d102526d9 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -13,9 +13,13 @@ linters: disable-all: true enable: - errcheck + - goimports - gosimple - govet - ineffassign - staticcheck - typecheck - unused +linters-settings: + goimports: + local-prefixes: github.com/Azure/ARO-HCP \ No newline at end of file diff --git a/frontend/frontend.go b/frontend/frontend.go index 6e9b84631..1105b7f31 100644 --- a/frontend/frontend.go +++ b/frontend/frontend.go @@ -15,10 +15,11 @@ import ( "strings" "sync/atomic" + "github.com/prometheus/client_golang/prometheus/promhttp" + "github.com/Azure/ARO-HCP/internal/api" "github.com/Azure/ARO-HCP/internal/api/arm" "github.com/Azure/ARO-HCP/internal/metrics" - "github.com/prometheus/client_golang/prometheus/promhttp" ) const ( diff --git a/frontend/metrics.go b/frontend/metrics.go index 352ce762f..cff1c5309 100644 --- a/frontend/metrics.go +++ b/frontend/metrics.go @@ -8,10 +8,10 @@ import ( "strconv" "time" + "github.com/prometheus/client_golang/prometheus" "golang.org/x/exp/maps" "github.com/Azure/ARO-HCP/internal/metrics" - "github.com/prometheus/client_golang/prometheus" ) type PrometheusEmitter struct { diff --git a/frontend/middleware_logging_test.go b/frontend/middleware_logging_test.go index 6b5c7ad36..f69f6fad3 100644 --- a/frontend/middleware_logging_test.go +++ b/frontend/middleware_logging_test.go @@ -9,9 +9,10 @@ import ( "testing" "time" + "github.com/google/uuid" + "github.com/Azure/ARO-HCP/internal/api" "github.com/Azure/ARO-HCP/internal/api/arm" - "github.com/google/uuid" ) const ( diff --git a/internal/api/registry.go b/internal/api/registry.go index c9d0cb2c5..8a00ef398 100644 --- a/internal/api/registry.go +++ b/internal/api/registry.go @@ -9,8 +9,9 @@ import ( "reflect" "strings" - "github.com/Azure/ARO-HCP/internal/api/arm" validator "github.com/go-playground/validator/v10" + + "github.com/Azure/ARO-HCP/internal/api/arm" ) const (