From e58dae3b50d389ba8257375916306798410eb13f Mon Sep 17 00:00:00 2001 From: Denis Titusov Date: Mon, 6 May 2024 14:08:51 +0400 Subject: [PATCH] minor: bump package version up to v2 (#32) --- commands/flags/slog.go | 2 +- commands/migrate.go | 10 +++++----- commands/server.go | 10 +++++----- go.mod | 2 +- internal/business/snippets/entities_requests_test.go | 4 ++-- internal/business/snippets/entities_response.go | 2 +- internal/business/snippets/pagination.go | 2 +- internal/business/snippets/pagination_test.go | 4 ++-- internal/business/snippets/service.go | 2 +- internal/business/snippets/service_mock_test.go | 4 ++-- internal/business/snippets/service_test.go | 6 +++--- internal/business/snippets/storage.go | 2 +- internal/business/snippets/storage_test.go | 6 +++--- internal/business/snippets/transport.go | 4 ++-- internal/business/snippets/transport_mock_test.go | 4 ++-- internal/business/snippets/transport_test.go | 6 +++--- internal/infrastructure/api/authentication_test.go | 4 ++-- internal/infrastructure/api/middleware_test.go | 4 ++-- internal/infrastructure/api/response.go | 2 +- internal/infrastructure/api/response_test.go | 4 ++-- internal/infrastructure/postgres/pgtest/create.go | 2 +- internal/infrastructure/postgres/pgtest/flags.go | 2 +- internal/infrastructure/postgres/pgtest/postgresql.go | 2 +- .../infrastructure/postgres/pgtest/postgresql_test.go | 4 ++-- internal/infrastructure/service/errors_test.go | 2 +- main.go | 4 ++-- main_test.go | 4 ++-- 27 files changed, 52 insertions(+), 52 deletions(-) diff --git a/commands/flags/slog.go b/commands/flags/slog.go index b334b37..64d4110 100644 --- a/commands/flags/slog.go +++ b/commands/flags/slog.go @@ -5,7 +5,7 @@ import ( "log/slog" "os" - "github.com/titusjaka/go-sample/internal/infrastructure/nopslog" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/nopslog" ) type Logger struct { diff --git a/commands/migrate.go b/commands/migrate.go index 5552ac4..a182704 100644 --- a/commands/migrate.go +++ b/commands/migrate.go @@ -5,11 +5,11 @@ import ( "fmt" "log/slog" - "github.com/titusjaka/go-sample/commands/flags" - "github.com/titusjaka/go-sample/internal/infrastructure/postgres" - "github.com/titusjaka/go-sample/internal/infrastructure/postgres/pgmigrator" - "github.com/titusjaka/go-sample/internal/infrastructure/postgres/pgtest" - "github.com/titusjaka/go-sample/migrations" + "github.com/titusjaka/go-sample/v2/commands/flags" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/postgres" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/postgres/pgmigrator" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/postgres/pgtest" + "github.com/titusjaka/go-sample/v2/migrations" ) // MigrateCmd implements kong.Command for migrations. To use this command you need to add migrate.Command diff --git a/commands/server.go b/commands/server.go index c750ea4..c0406d8 100644 --- a/commands/server.go +++ b/commands/server.go @@ -17,11 +17,11 @@ import ( "github.com/go-chi/render" "golang.org/x/sync/errgroup" - "github.com/titusjaka/go-sample/commands/flags" - "github.com/titusjaka/go-sample/internal/business/snippets" - "github.com/titusjaka/go-sample/internal/infrastructure/api" - "github.com/titusjaka/go-sample/internal/infrastructure/kongflag" - "github.com/titusjaka/go-sample/internal/infrastructure/postgres" + "github.com/titusjaka/go-sample/v2/commands/flags" + "github.com/titusjaka/go-sample/v2/internal/business/snippets" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/api" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/kongflag" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/postgres" ) // ServerCmd implements kong.Command for the main server command. diff --git a/go.mod b/go.mod index 74e1930..4c9f0f1 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/titusjaka/go-sample +module github.com/titusjaka/go-sample/v2 go 1.22 diff --git a/internal/business/snippets/entities_requests_test.go b/internal/business/snippets/entities_requests_test.go index 4f0604e..a7208de 100644 --- a/internal/business/snippets/entities_requests_test.go +++ b/internal/business/snippets/entities_requests_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/titusjaka/go-sample/internal/business/snippets" - "github.com/titusjaka/go-sample/internal/infrastructure/utils/testutils" + "github.com/titusjaka/go-sample/v2/internal/business/snippets" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/utils/testutils" ) func TestCreateSnippetRequest_Validate(t *testing.T) { diff --git a/internal/business/snippets/entities_response.go b/internal/business/snippets/entities_response.go index 5685c20..2aedcbe 100644 --- a/internal/business/snippets/entities_response.go +++ b/internal/business/snippets/entities_response.go @@ -3,7 +3,7 @@ package snippets import ( "time" - "github.com/titusjaka/go-sample/internal/infrastructure/service" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/service" ) // SnippetResponse represents a common snippet-response struct diff --git a/internal/business/snippets/pagination.go b/internal/business/snippets/pagination.go index 84a40b2..693ae84 100644 --- a/internal/business/snippets/pagination.go +++ b/internal/business/snippets/pagination.go @@ -5,7 +5,7 @@ import ( "math" "strings" - "github.com/titusjaka/go-sample/internal/infrastructure/service" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/service" ) const ( diff --git a/internal/business/snippets/pagination_test.go b/internal/business/snippets/pagination_test.go index 2f06f36..2c9c4b2 100644 --- a/internal/business/snippets/pagination_test.go +++ b/internal/business/snippets/pagination_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/titusjaka/go-sample/internal/business/snippets" - "github.com/titusjaka/go-sample/internal/infrastructure/service" + "github.com/titusjaka/go-sample/v2/internal/business/snippets" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/service" ) func TestNewPagination(t *testing.T) { diff --git a/internal/business/snippets/service.go b/internal/business/snippets/service.go index e683694..8a2acd3 100644 --- a/internal/business/snippets/service.go +++ b/internal/business/snippets/service.go @@ -7,7 +7,7 @@ import ( "log/slog" "time" - "github.com/titusjaka/go-sample/internal/infrastructure/service" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/service" ) //go:generate go run go.uber.org/mock/mockgen -typed -source=service.go -destination ./service_mock_test.go -package snippets_test -mock_names Storage=MockStorage diff --git a/internal/business/snippets/service_mock_test.go b/internal/business/snippets/service_mock_test.go index e586b2d..6c8eddf 100644 --- a/internal/business/snippets/service_mock_test.go +++ b/internal/business/snippets/service_mock_test.go @@ -13,8 +13,8 @@ import ( context "context" reflect "reflect" - snippets "github.com/titusjaka/go-sample/internal/business/snippets" - service "github.com/titusjaka/go-sample/internal/infrastructure/service" + snippets "github.com/titusjaka/go-sample/v2/internal/business/snippets" + service "github.com/titusjaka/go-sample/v2/internal/infrastructure/service" gomock "go.uber.org/mock/gomock" ) diff --git a/internal/business/snippets/service_test.go b/internal/business/snippets/service_test.go index ea592cb..5535a6d 100644 --- a/internal/business/snippets/service_test.go +++ b/internal/business/snippets/service_test.go @@ -10,9 +10,9 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" - "github.com/titusjaka/go-sample/internal/business/snippets" - "github.com/titusjaka/go-sample/internal/infrastructure/nopslog" - "github.com/titusjaka/go-sample/internal/infrastructure/service" + "github.com/titusjaka/go-sample/v2/internal/business/snippets" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/nopslog" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/service" ) func TestSnippetService_Create(t *testing.T) { diff --git a/internal/business/snippets/storage.go b/internal/business/snippets/storage.go index 2dda1a7..3afa235 100644 --- a/internal/business/snippets/storage.go +++ b/internal/business/snippets/storage.go @@ -6,7 +6,7 @@ import ( "errors" "fmt" - "github.com/titusjaka/go-sample/internal/infrastructure/service" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/service" ) // ErrNotFound error used to signal higher level about sql.ErrNoRows error diff --git a/internal/business/snippets/storage_test.go b/internal/business/snippets/storage_test.go index 2023db0..cc63fc4 100644 --- a/internal/business/snippets/storage_test.go +++ b/internal/business/snippets/storage_test.go @@ -11,9 +11,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/titusjaka/go-sample/internal/business/snippets" - "github.com/titusjaka/go-sample/internal/infrastructure/postgres/pgtest" - "github.com/titusjaka/go-sample/internal/infrastructure/service" + "github.com/titusjaka/go-sample/v2/internal/business/snippets" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/postgres/pgtest" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/service" ) const envFile = "../../../.env" diff --git a/internal/business/snippets/transport.go b/internal/business/snippets/transport.go index 27bf6c3..468d5e8 100644 --- a/internal/business/snippets/transport.go +++ b/internal/business/snippets/transport.go @@ -11,8 +11,8 @@ import ( "github.com/go-chi/render" "github.com/gorilla/schema" - "github.com/titusjaka/go-sample/internal/infrastructure/api" - "github.com/titusjaka/go-sample/internal/infrastructure/service" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/api" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/service" ) //go:generate go run go.uber.org/mock/mockgen -typed -source=transport.go -destination ./transport_mock_test.go -package snippets_test -mock_names Service=MockService diff --git a/internal/business/snippets/transport_mock_test.go b/internal/business/snippets/transport_mock_test.go index 9965d1a..287323e 100644 --- a/internal/business/snippets/transport_mock_test.go +++ b/internal/business/snippets/transport_mock_test.go @@ -13,8 +13,8 @@ import ( context "context" reflect "reflect" - snippets "github.com/titusjaka/go-sample/internal/business/snippets" - service "github.com/titusjaka/go-sample/internal/infrastructure/service" + snippets "github.com/titusjaka/go-sample/v2/internal/business/snippets" + service "github.com/titusjaka/go-sample/v2/internal/infrastructure/service" gomock "go.uber.org/mock/gomock" ) diff --git a/internal/business/snippets/transport_test.go b/internal/business/snippets/transport_test.go index 1ced296..0611b5a 100644 --- a/internal/business/snippets/transport_test.go +++ b/internal/business/snippets/transport_test.go @@ -9,9 +9,9 @@ import ( "github.com/gavv/httpexpect/v2" "go.uber.org/mock/gomock" - "github.com/titusjaka/go-sample/internal/business/snippets" - "github.com/titusjaka/go-sample/internal/infrastructure/nopslog" - "github.com/titusjaka/go-sample/internal/infrastructure/service" + "github.com/titusjaka/go-sample/v2/internal/business/snippets" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/nopslog" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/service" ) func TestTransport_listSnippets(t *testing.T) { diff --git a/internal/infrastructure/api/authentication_test.go b/internal/infrastructure/api/authentication_test.go index eeadd9e..219fcbf 100644 --- a/internal/infrastructure/api/authentication_test.go +++ b/internal/infrastructure/api/authentication_test.go @@ -11,8 +11,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/titusjaka/go-sample/internal/infrastructure/api" - "github.com/titusjaka/go-sample/internal/infrastructure/nopslog" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/api" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/nopslog" ) func TestApi_InternalCommunication(t *testing.T) { diff --git a/internal/infrastructure/api/middleware_test.go b/internal/infrastructure/api/middleware_test.go index 5ba4741..b6158bf 100644 --- a/internal/infrastructure/api/middleware_test.go +++ b/internal/infrastructure/api/middleware_test.go @@ -11,8 +11,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/titusjaka/go-sample/internal/infrastructure/api" - "github.com/titusjaka/go-sample/internal/infrastructure/nopslog" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/api" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/nopslog" ) func TestApi_NotFoundHandler(t *testing.T) { diff --git a/internal/infrastructure/api/response.go b/internal/infrastructure/api/response.go index a9449fe..b70d189 100644 --- a/internal/infrastructure/api/response.go +++ b/internal/infrastructure/api/response.go @@ -6,7 +6,7 @@ import ( "github.com/go-chi/render" - "github.com/titusjaka/go-sample/internal/infrastructure/service" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/service" ) // ErrResponse renderer type for handling all sorts of business errors. diff --git a/internal/infrastructure/api/response_test.go b/internal/infrastructure/api/response_test.go index a490639..f69b69a 100644 --- a/internal/infrastructure/api/response_test.go +++ b/internal/infrastructure/api/response_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/titusjaka/go-sample/internal/infrastructure/api" - "github.com/titusjaka/go-sample/internal/infrastructure/service" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/api" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/service" ) func TestNewErrResponse(t *testing.T) { diff --git a/internal/infrastructure/postgres/pgtest/create.go b/internal/infrastructure/postgres/pgtest/create.go index 358cfff..d73d834 100644 --- a/internal/infrastructure/postgres/pgtest/create.go +++ b/internal/infrastructure/postgres/pgtest/create.go @@ -5,7 +5,7 @@ import ( "fmt" "io/fs" - "github.com/titusjaka/go-sample/internal/infrastructure/postgres/pgmigrator" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/postgres/pgmigrator" ) func CreateTemplateDatabase(flags Flags, migrations fs.FS) error { diff --git a/internal/infrastructure/postgres/pgtest/flags.go b/internal/infrastructure/postgres/pgtest/flags.go index 3701f5c..4afd5ca 100644 --- a/internal/infrastructure/postgres/pgtest/flags.go +++ b/internal/infrastructure/postgres/pgtest/flags.go @@ -1,7 +1,7 @@ package pgtest import ( - "github.com/titusjaka/go-sample/internal/infrastructure/postgres" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/postgres" ) type Flags struct { diff --git a/internal/infrastructure/postgres/pgtest/postgresql.go b/internal/infrastructure/postgres/pgtest/postgresql.go index 7785ce0..bd59fc3 100644 --- a/internal/infrastructure/postgres/pgtest/postgresql.go +++ b/internal/infrastructure/postgres/pgtest/postgresql.go @@ -14,7 +14,7 @@ import ( kongdotenv "github.com/titusjaka/kong-dotenv-go" - "github.com/titusjaka/go-sample/internal/infrastructure/postgres/pgmigrator" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/postgres/pgmigrator" ) // InitTestDatabase creates initializes a new dummy database in s PostgreSQL server diff --git a/internal/infrastructure/postgres/pgtest/postgresql_test.go b/internal/infrastructure/postgres/pgtest/postgresql_test.go index 372eec4..89a772a 100644 --- a/internal/infrastructure/postgres/pgtest/postgresql_test.go +++ b/internal/infrastructure/postgres/pgtest/postgresql_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/titusjaka/go-sample/internal/infrastructure/postgres/pgtest" - "github.com/titusjaka/go-sample/internal/infrastructure/postgres/pgtest/testdata" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/postgres/pgtest" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/postgres/pgtest/testdata" ) const ( diff --git a/internal/infrastructure/service/errors_test.go b/internal/infrastructure/service/errors_test.go index ac00765..65acfef 100644 --- a/internal/infrastructure/service/errors_test.go +++ b/internal/infrastructure/service/errors_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/titusjaka/go-sample/internal/infrastructure/service" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/service" ) func TestError_Error(t *testing.T) { diff --git a/main.go b/main.go index ac67f4b..5795f8e 100644 --- a/main.go +++ b/main.go @@ -5,8 +5,8 @@ import ( kongdotenv "github.com/titusjaka/kong-dotenv-go" - "github.com/titusjaka/go-sample/commands" - "github.com/titusjaka/go-sample/internal/infrastructure/kongflag" + "github.com/titusjaka/go-sample/v2/commands" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/kongflag" ) type App struct { diff --git a/main_test.go b/main_test.go index d6fb9b6..d0ce5cb 100644 --- a/main_test.go +++ b/main_test.go @@ -9,8 +9,8 @@ import ( kongdotenv "github.com/titusjaka/kong-dotenv-go" - "github.com/titusjaka/go-sample/internal/infrastructure/postgres/pgtest" - "github.com/titusjaka/go-sample/migrations" + "github.com/titusjaka/go-sample/v2/internal/infrastructure/postgres/pgtest" + "github.com/titusjaka/go-sample/v2/migrations" ) func TestMain(m *testing.M) {