From 7a426b647bdcb1979494ec867bdf24c64e0ad3cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D1=83=D0=B7=D0=BD=D0=B5=D1=86=D0=BE=D0=B2=20=D0=98?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=20=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD?= =?UTF-8?q?=D0=B4=D1=80=D0=BE=D0=B2=D0=B8=D1=87?= Date: Fri, 11 Apr 2025 13:36:48 +0300 Subject: [PATCH] MSP-5223 sort imports --- cmd/migrate/main.go | 5 +++-- controller/api/variable.go | 1 + controller/module.go | 2 +- domain/variable.go | 3 ++- helpers/helpers.go | 3 ++- middlewares/ws_log.go | 1 + repository/config.go | 1 + repository/variable.go | 3 ++- routes/routes.go | 3 ++- service/module/backend/backend.go | 1 + service/module/backend/cleaner.go | 1 + service/module/emitter.go | 3 ++- service/module/service.go | 3 ++- service/rqlite/credentials.go | 1 + service/rqlite/main.go | 9 +++++---- service/rqlite/runner.go | 3 ++- service/subscription/service.go | 1 + tests/variable_test.go | 7 ++++--- 18 files changed, 34 insertions(+), 17 deletions(-) diff --git a/cmd/migrate/main.go b/cmd/migrate/main.go index 5afa018..fb8a288 100644 --- a/cmd/migrate/main.go +++ b/cmd/migrate/main.go @@ -4,6 +4,9 @@ import ( "context" "database/sql" "fmt" + "os" + "time" + "github.com/pressly/goose/v3" "github.com/txix-open/isp-kit/config" "github.com/txix-open/isp-kit/dbx" @@ -12,8 +15,6 @@ import ( "github.com/txix-open/isp-kit/log" "github.com/txix-open/isp-kit/validator" "isp-config-service/service/rqlite/goose_store" - "os" - "time" "github.com/jmoiron/sqlx" _ "github.com/mattn/go-sqlite3" diff --git a/controller/api/variable.go b/controller/api/variable.go index 6f608ad..89aef8c 100644 --- a/controller/api/variable.go +++ b/controller/api/variable.go @@ -3,6 +3,7 @@ package api import ( "context" + "github.com/pkg/errors" "github.com/txix-open/isp-kit/grpc/apierrors" _ "github.com/txix-open/isp-kit/grpc/apierrors" diff --git a/controller/module.go b/controller/module.go index 95188c4..452ac4e 100644 --- a/controller/module.go +++ b/controller/module.go @@ -2,9 +2,9 @@ package controller import ( "context" - "github.com/txix-open/etp/v4" "github.com/pkg/errors" + "github.com/txix-open/etp/v4" "github.com/txix-open/etp/v4/msg" "github.com/txix-open/isp-kit/cluster" "github.com/txix-open/isp-kit/json" diff --git a/domain/variable.go b/domain/variable.go index 7ec3df0..1caaa2c 100644 --- a/domain/variable.go +++ b/domain/variable.go @@ -1,8 +1,9 @@ package domain import ( - "isp-config-service/entity" "time" + + "isp-config-service/entity" ) type Variable struct { diff --git a/helpers/helpers.go b/helpers/helpers.go index 555bbf3..d5a0882 100644 --- a/helpers/helpers.go +++ b/helpers/helpers.go @@ -1,12 +1,13 @@ package helpers import ( + "net" + "github.com/pkg/errors" "github.com/txix-open/etp/v4" "github.com/txix-open/isp-kit/cluster" "github.com/txix-open/isp-kit/log" "isp-config-service/entity" - "net" ) func ModuleName(conn *etp.Conn) string { diff --git a/middlewares/ws_log.go b/middlewares/ws_log.go index 685ad8e..4c20c7c 100644 --- a/middlewares/ws_log.go +++ b/middlewares/ws_log.go @@ -2,6 +2,7 @@ package middlewares import ( "context" + "github.com/txix-open/etp/v4" "github.com/txix-open/etp/v4/msg" diff --git a/repository/config.go b/repository/config.go index 365ad7f..96972ff 100644 --- a/repository/config.go +++ b/repository/config.go @@ -3,6 +3,7 @@ package repository import ( "context" "fmt" + "github.com/Masterminds/squirrel" "github.com/pkg/errors" "isp-config-service/entity" diff --git a/repository/variable.go b/repository/variable.go index a935e35..c87dbb2 100644 --- a/repository/variable.go +++ b/repository/variable.go @@ -4,12 +4,13 @@ import ( "context" "database/sql" "fmt" + "strings" + "github.com/Masterminds/squirrel" "github.com/pkg/errors" "isp-config-service/entity" "isp-config-service/middlewares/sql_metrics" "isp-config-service/service/rqlite/db" - "strings" ) type Variable struct { diff --git a/routes/routes.go b/routes/routes.go index b31a987..f994a6b 100644 --- a/routes/routes.go +++ b/routes/routes.go @@ -1,9 +1,10 @@ package routes import ( + "net/http" + "github.com/txix-open/etp/v4" "isp-config-service/conf" - "net/http" "github.com/txix-open/isp-kit/cluster" "github.com/txix-open/isp-kit/grpc" diff --git a/service/module/backend/backend.go b/service/module/backend/backend.go index 479d15d..c7ce6af 100644 --- a/service/module/backend/backend.go +++ b/service/module/backend/backend.go @@ -3,6 +3,7 @@ package backend import ( "context" "fmt" + "github.com/pkg/errors" "github.com/txix-open/etp/v4" "github.com/txix-open/isp-kit/cluster" diff --git a/service/module/backend/cleaner.go b/service/module/backend/cleaner.go index 98a668d..4ebc566 100644 --- a/service/module/backend/cleaner.go +++ b/service/module/backend/cleaner.go @@ -3,6 +3,7 @@ package backend import ( "context" "fmt" + "github.com/pkg/errors" "github.com/txix-open/isp-kit/log" ) diff --git a/service/module/emitter.go b/service/module/emitter.go index e5c84ef..d8b645c 100644 --- a/service/module/emitter.go +++ b/service/module/emitter.go @@ -2,10 +2,11 @@ package module import ( "context" - "github.com/txix-open/etp/v4" "strings" "time" + "github.com/txix-open/etp/v4" + "github.com/pkg/errors" "github.com/txix-open/isp-kit/cluster" "github.com/txix-open/isp-kit/log" diff --git a/service/module/service.go b/service/module/service.go index d10baa1..ae71330 100644 --- a/service/module/service.go +++ b/service/module/service.go @@ -4,6 +4,8 @@ import ( "context" "crypto/sha256" "encoding/hex" + "strings" + "github.com/google/uuid" "github.com/pkg/errors" "github.com/txix-open/etp/v4" @@ -14,7 +16,6 @@ import ( "isp-config-service/entity" "isp-config-service/entity/xtypes" "isp-config-service/helpers" - "strings" ) const ( diff --git a/service/rqlite/credentials.go b/service/rqlite/credentials.go index 1b4d434..ccef6a9 100644 --- a/service/rqlite/credentials.go +++ b/service/rqlite/credentials.go @@ -2,6 +2,7 @@ package rqlite import ( "bytes" + "github.com/pkg/errors" "github.com/rqlite/rqlite/v8/auth" "github.com/txix-open/isp-kit/json" diff --git a/service/rqlite/main.go b/service/rqlite/main.go index d9e5b24..d31557b 100644 --- a/service/rqlite/main.go +++ b/service/rqlite/main.go @@ -7,10 +7,6 @@ import ( "crypto/tls" "encoding/json" "fmt" - "github.com/pkg/errors" - "github.com/rqlite/rqlite-disco-clients/dns" - "github.com/rqlite/rqlite-disco-clients/dnssrv" - "github.com/txix-open/isp-kit/config" "log" "net" "os" @@ -20,6 +16,11 @@ import ( "strings" "time" + "github.com/pkg/errors" + "github.com/rqlite/rqlite-disco-clients/dns" + "github.com/rqlite/rqlite-disco-clients/dnssrv" + "github.com/txix-open/isp-kit/config" + "github.com/rqlite/rqlite/v8/auth" "github.com/rqlite/rqlite/v8/cluster" "github.com/rqlite/rqlite/v8/cmd" diff --git a/service/rqlite/runner.go b/service/rqlite/runner.go index b08ad3e..04935b1 100644 --- a/service/rqlite/runner.go +++ b/service/rqlite/runner.go @@ -4,9 +4,10 @@ import ( "context" "database/sql" "fmt" + "time" + "github.com/rqlite/rqlite/v8/auth" "github.com/txix-open/isp-kit/http/httpcli" - "time" "github.com/pkg/errors" _ "github.com/rqlite/gorqlite/stdlib" diff --git a/service/subscription/service.go b/service/subscription/service.go index d6572ee..08ae816 100644 --- a/service/subscription/service.go +++ b/service/subscription/service.go @@ -2,6 +2,7 @@ package subscription import ( "context" + "github.com/txix-open/etp/v4" "github.com/pkg/errors" diff --git a/tests/variable_test.go b/tests/variable_test.go index 88d8baa..3e8ee0a 100644 --- a/tests/variable_test.go +++ b/tests/variable_test.go @@ -1,15 +1,16 @@ package tests_test import ( + "strconv" + "testing" + "time" + "github.com/stretchr/testify/require" "github.com/txix-open/isp-kit/cluster" "github.com/txix-open/isp-kit/grpc/client" "github.com/txix-open/isp-kit/json" "github.com/txix-open/isp-kit/test/fake" "isp-config-service/domain" - "strconv" - "testing" - "time" ) const defaultRemoteConfigsWithVariables = `