From a3870b09270eb8f301afe3aaf8d2db4b36a214fd Mon Sep 17 00:00:00 2001 From: daniel <40469266+daniel-burghardt@users.noreply.github.com> Date: Mon, 6 May 2024 13:14:50 -0300 Subject: [PATCH 01/18] go workflow --- .github/workflows/go.yaml | 57 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/go.yaml diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml new file mode 100644 index 0000000..d519a5c --- /dev/null +++ b/.github/workflows/go.yaml @@ -0,0 +1,57 @@ +name: Go + +on: + push: + branches: [main] + pull_request: + branches: ["**"] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.22" + + - name: Build Project + run: go build ./... + + test: + runs-on: ubuntu-latest + services: + postgres: + image: postgres:16-alpine + env: + POSTGRES_USER: postgres + POSTGRES_DB: postgres + POSTGRES_PASSWORD: postgres + PGHOST: localhost + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + env: + PGUSER: postgres + PGPASSWORD: postgres + PGHOST: localhost + PGPORT: 5432 + DATABASE_URL: postgres://postgres@localhost:5432/postgres?sslmode=disable + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.22" + + - name: Run Tests + run: go test -v -race -cover ./... From 2b55ae0e315c145a9b97e4c29ccd545eeb8354a6 Mon Sep 17 00:00:00 2001 From: daniel <40469266+daniel-burghardt@users.noreply.github.com> Date: Mon, 6 May 2024 13:19:02 -0300 Subject: [PATCH 02/18] golangci-lint --- .github/workflows/go.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index d519a5c..dab7bf5 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -7,6 +7,23 @@ on: branches: ["**"] jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.22" + + - name: golangci-lint + uses: golangci/golangci-lint-action@v4 + with: + version: v1.58 + args: --timeout=5m + build: runs-on: ubuntu-latest steps: From aa1c1aab021e35883a7b749144db145d6d2022b2 Mon Sep 17 00:00:00 2001 From: daniel <40469266+daniel-burghardt@users.noreply.github.com> Date: Mon, 6 May 2024 13:27:22 -0300 Subject: [PATCH 03/18] fix: linter --- cmd/root.go | 7 +++++-- internal/serve/errors_test.go | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 4644db1..7a10ffc 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -13,7 +13,10 @@ var rootCmd = &cobra.Command{ Use: "wallet-backend", Short: "Wallet Backend Server", Run: func(cmd *cobra.Command, args []string) { - cmd.Help() + err := cmd.Help() + if err != nil { + log.Fatalf("Error calling help command: %s", err.Error()) + } }, } @@ -22,7 +25,7 @@ var rootCmd = &cobra.Command{ func Execute() { err := rootCmd.Execute() if err != nil { - log.Fatal(err) + log.Fatalf("Error executing root command: %s", err.Error()) } } diff --git a/internal/serve/errors_test.go b/internal/serve/errors_test.go index ebec5d3..ea77406 100644 --- a/internal/serve/errors_test.go +++ b/internal/serve/errors_test.go @@ -2,7 +2,7 @@ package serve import ( "fmt" - "io/ioutil" + "io" "net/http" "net/http/httptest" "testing" @@ -36,7 +36,7 @@ func TestErrorResponseRender(t *testing.T) { tc.in.Render(w) resp := w.Result() assert.Equal(t, tc.want.Status, resp.StatusCode) - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) require.NoError(t, err) assert.JSONEq(t, fmt.Sprintf(`{"error":%q}`, tc.want.Error), string(body)) }) @@ -69,7 +69,7 @@ func TestErrorHandler(t *testing.T) { tc.in.ServeHTTP(w, r) resp := w.Result() assert.Equal(t, tc.want.Status, resp.StatusCode) - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) require.NoError(t, err) assert.JSONEq(t, fmt.Sprintf(`{"error":%q}`, tc.want.Error), string(body)) }) From d4e2c4112d49b2e4b08840cfc00d91564a382276 Mon Sep 17 00:00:00 2001 From: daniel <40469266+daniel-burghardt@users.noreply.github.com> Date: Wed, 8 May 2024 16:56:21 -0300 Subject: [PATCH 04/18] rework: exhaustive, deadcode and gomod check --- .github/workflows/go.yaml | 20 ++++++++++++++++++++ gomod.sh | 8 ++++++++ 2 files changed, 28 insertions(+) create mode 100644 gomod.sh diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index dab7bf5..b821dab 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -23,6 +23,26 @@ jobs: with: version: v1.58 args: --timeout=5m + + - name: ./gomod.sh + run: ./gomod.sh + + - name: exhaustive github.com/nishanths/exhaustive@v0.12.0 + run: | + go install github.com/nishanths/exhaustive/cmd/exhaustive@v0.12.0 + exhaustive -default-signifies-exhaustive ./... + + - name: deadcode golang.org/x/tools/cmd/deadcode@v0.21.0 + run: | + go install golang.org/x/tools/cmd/deadcode@v0.21.0 + output=$(deadcode -test ./...) + if [[ -n "$output" ]]; then + echo "🚨 Deadcode found:" + echo "$output" + exit 1 + else + echo "✅ No deadcode found" + fi build: runs-on: ubuntu-latest diff --git a/gomod.sh b/gomod.sh new file mode 100644 index 0000000..714702f --- /dev/null +++ b/gomod.sh @@ -0,0 +1,8 @@ +#! /bin/bash +set -e + +go mod tidy +git diff --exit-code -- go.mod || (echo "Go file go.mod is dirty, update the file with 'go mod tidy' locally." && exit 1) +git diff --exit-code -- go.sum || (echo "Go file go.sum is dirty, update the file with 'go mod tidy' locally." && exit 1) +diff -u go.list <(go list -m all) || (echo "Go dependencies have changed, update the go.list file with 'go list -m all > go.list' locally." && exit 1) +go mod verify || (echo "One or more Go dependencies failed verification. Either a version is no longer available, or the author or someone else has modified the version so it no longer points to the same code." && exit 1) \ No newline at end of file From d4eedca9b16252588ca038922a39a97e2c024bf2 Mon Sep 17 00:00:00 2001 From: daniel <40469266+daniel-burghardt@users.noreply.github.com> Date: Wed, 8 May 2024 18:04:42 -0300 Subject: [PATCH 05/18] rework: gomod --- gomod.sh | 1 - 1 file changed, 1 deletion(-) mode change 100644 => 100755 gomod.sh diff --git a/gomod.sh b/gomod.sh old mode 100644 new mode 100755 index 714702f..f90f958 --- a/gomod.sh +++ b/gomod.sh @@ -4,5 +4,4 @@ set -e go mod tidy git diff --exit-code -- go.mod || (echo "Go file go.mod is dirty, update the file with 'go mod tidy' locally." && exit 1) git diff --exit-code -- go.sum || (echo "Go file go.sum is dirty, update the file with 'go mod tidy' locally." && exit 1) -diff -u go.list <(go list -m all) || (echo "Go dependencies have changed, update the go.list file with 'go list -m all > go.list' locally." && exit 1) go mod verify || (echo "One or more Go dependencies failed verification. Either a version is no longer available, or the author or someone else has modified the version so it no longer points to the same code." && exit 1) \ No newline at end of file From d23f0f59693d00a487754e3f9e0881d655b55160 Mon Sep 17 00:00:00 2001 From: daniel <40469266+daniel-burghardt@users.noreply.github.com> Date: Wed, 8 May 2024 18:32:44 -0300 Subject: [PATCH 06/18] rework: db dsn override --- internal/db/db.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/db/db.go b/internal/db/db.go index a38ba38..2fc36f9 100644 --- a/internal/db/db.go +++ b/internal/db/db.go @@ -19,12 +19,17 @@ type ConnectionPool interface { SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error } +// Make sure *DBConnectionPoolImplementation implements DBConnectionPool: +var _ ConnectionPool = (*DBConnectionPoolImplementation)(nil) + type DBConnectionPoolImplementation struct { *sqlx.DB + dataSourceName string } -// Make sure *DBConnectionPoolImplementation implements DBConnectionPool: -var _ ConnectionPool = (*DBConnectionPoolImplementation)(nil) +func (db *DBConnectionPoolImplementation) DSN(ctx context.Context) (string, error) { + return db.dataSourceName, nil +} const ( MaxDBConnIdleTime = 10 * time.Second From a46225a4bf4a393e53e79a296ef157f2aa835370 Mon Sep 17 00:00:00 2001 From: daniel <40469266+daniel-burghardt@users.noreply.github.com> Date: Thu, 9 May 2024 14:48:53 -0300 Subject: [PATCH 07/18] test --- internal/db/db.go | 5 ----- internal/db/dbtest/dbtest_test.go | 29 +++++++++++------------------ 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/internal/db/db.go b/internal/db/db.go index 2fc36f9..5806bac 100644 --- a/internal/db/db.go +++ b/internal/db/db.go @@ -24,11 +24,6 @@ var _ ConnectionPool = (*DBConnectionPoolImplementation)(nil) type DBConnectionPoolImplementation struct { *sqlx.DB - dataSourceName string -} - -func (db *DBConnectionPoolImplementation) DSN(ctx context.Context) (string, error) { - return db.dataSourceName, nil } const ( diff --git a/internal/db/dbtest/dbtest_test.go b/internal/db/dbtest/dbtest_test.go index ca669fa..a090cfe 100644 --- a/internal/db/dbtest/dbtest_test.go +++ b/internal/db/dbtest/dbtest_test.go @@ -1,20 +1,13 @@ package dbtest -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestOpen(t *testing.T) { - db := Open(t) - defer db.Close() - conn := db.Open() - defer conn.Close() - - count := 0 - err := conn.Get(&count, `SELECT COUNT(*) FROM gorp_migrations`) - require.NoError(t, err) - assert.Greater(t, count, 0) -} +// func TestOpen(t *testing.T) { +// db := Open(t) +// defer db.Close() +// conn := db.Open() +// defer conn.Close() + +// count := 0 +// err := conn.Get(&count, `SELECT COUNT(*) FROM gorp_migrations`) +// require.NoError(t, err) +// assert.Greater(t, count, 0) +// } From 169ee3bede88b6893a56dc660aee8b28cc7d9977 Mon Sep 17 00:00:00 2001 From: daniel <40469266+daniel-burghardt@users.noreply.github.com> Date: Thu, 9 May 2024 14:58:44 -0300 Subject: [PATCH 08/18] test 2 --- .github/workflows/go.yaml | 11 +++-------- internal/db/dbtest/dbtest_test.go | 29 ++++++++++++++++++----------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index b821dab..c0c2db2 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -64,10 +64,8 @@ jobs: postgres: image: postgres:16-alpine env: - POSTGRES_USER: postgres - POSTGRES_DB: postgres - POSTGRES_PASSWORD: postgres - PGHOST: localhost + POSTGRES_HOST_AUTH_METHOD: trust + POSTGRES_DB: wallet-backend options: >- --health-cmd pg_isready --health-interval 10s @@ -76,11 +74,8 @@ jobs: ports: - 5432:5432 env: - PGUSER: postgres - PGPASSWORD: postgres - PGHOST: localhost PGPORT: 5432 - DATABASE_URL: postgres://postgres@localhost:5432/postgres?sslmode=disable + DATABASE_URL: postgres://postgres@localhost:5432/wallet-backend?sslmode=disable steps: - name: Checkout uses: actions/checkout@v4 diff --git a/internal/db/dbtest/dbtest_test.go b/internal/db/dbtest/dbtest_test.go index a090cfe..ca669fa 100644 --- a/internal/db/dbtest/dbtest_test.go +++ b/internal/db/dbtest/dbtest_test.go @@ -1,13 +1,20 @@ package dbtest -// func TestOpen(t *testing.T) { -// db := Open(t) -// defer db.Close() -// conn := db.Open() -// defer conn.Close() - -// count := 0 -// err := conn.Get(&count, `SELECT COUNT(*) FROM gorp_migrations`) -// require.NoError(t, err) -// assert.Greater(t, count, 0) -// } +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestOpen(t *testing.T) { + db := Open(t) + defer db.Close() + conn := db.Open() + defer conn.Close() + + count := 0 + err := conn.Get(&count, `SELECT COUNT(*) FROM gorp_migrations`) + require.NoError(t, err) + assert.Greater(t, count, 0) +} From 078e041c39710a83f792df87886bbbd0cec77caf Mon Sep 17 00:00:00 2001 From: daniel <40469266+daniel-burghardt@users.noreply.github.com> Date: Thu, 9 May 2024 15:20:26 -0300 Subject: [PATCH 09/18] test 3 --- .github/workflows/go.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index c0c2db2..6a16347 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -64,8 +64,10 @@ jobs: postgres: image: postgres:16-alpine env: - POSTGRES_HOST_AUTH_METHOD: trust - POSTGRES_DB: wallet-backend + POSTGRES_USER: postgres + POSTGRES_DB: postgres + POSTGRES_PASSWORD: postgres + PGHOST: localhost options: >- --health-cmd pg_isready --health-interval 10s @@ -74,8 +76,11 @@ jobs: ports: - 5432:5432 env: + PGUSER: postgres + PGPASSWORD: postgres + PGHOST: localhost PGPORT: 5432 - DATABASE_URL: postgres://postgres@localhost:5432/wallet-backend?sslmode=disable + DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable steps: - name: Checkout uses: actions/checkout@v4 From 9f3948e8f0c77174163e6f5809444d0682a67bcb Mon Sep 17 00:00:00 2001 From: daniel <40469266+daniel-burghardt@users.noreply.github.com> Date: Thu, 9 May 2024 15:25:42 -0300 Subject: [PATCH 10/18] test 4 --- internal/data/payments_test.go | 6 +++--- internal/db/db_test.go | 6 +++--- internal/serve/httphandler/payments_handler_test.go | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/data/payments_test.go b/internal/data/payments_test.go index 119fe1d..cf6c683 100644 --- a/internal/data/payments_test.go +++ b/internal/data/payments_test.go @@ -13,10 +13,10 @@ import ( ) func TestSubscribeAddress(t *testing.T) { - dbtest := dbtest.Open(t) - defer dbtest.Close() + dbt := dbtest.Open(t) + defer dbt.Close() - dbConnectionPool, err := db.OpenDBConnectionPool(dbtest.DSN) + dbConnectionPool, err := db.OpenDBConnectionPool(dbt.DSN) require.NoError(t, err) defer dbConnectionPool.Close() diff --git a/internal/db/db_test.go b/internal/db/db_test.go index f981b8f..ee64545 100644 --- a/internal/db/db_test.go +++ b/internal/db/db_test.go @@ -9,10 +9,10 @@ import ( ) func TestOpenDBConnectionPool(t *testing.T) { - db := dbtest.Postgres(t) - defer db.Close() + dbt := dbtest.Postgres(t) + defer dbt.Close() - dbConnectionPool, err := OpenDBConnectionPool(db.DSN) + dbConnectionPool, err := OpenDBConnectionPool(dbt.DSN) require.NoError(t, err) defer dbConnectionPool.Close() diff --git a/internal/serve/httphandler/payments_handler_test.go b/internal/serve/httphandler/payments_handler_test.go index 9498dc2..d02358e 100644 --- a/internal/serve/httphandler/payments_handler_test.go +++ b/internal/serve/httphandler/payments_handler_test.go @@ -20,10 +20,10 @@ import ( ) func TestSubscribeAddress(t *testing.T) { - dbtest := dbtest.Open(t) - defer dbtest.Close() + dbt := dbtest.Open(t) + defer dbt.Close() - dbConnectionPool, err := db.OpenDBConnectionPool(dbtest.DSN) + dbConnectionPool, err := db.OpenDBConnectionPool(dbt.DSN) require.NoError(t, err) defer dbConnectionPool.Close() @@ -101,10 +101,10 @@ func TestSubscribeAddress(t *testing.T) { } func TestUnsubscribeAddress(t *testing.T) { - dbtest := dbtest.Open(t) - defer dbtest.Close() + dbt := dbtest.Open(t) + defer dbt.Close() - dbConnectionPool, err := db.OpenDBConnectionPool(dbtest.DSN) + dbConnectionPool, err := db.OpenDBConnectionPool(dbt.DSN) require.NoError(t, err) defer dbConnectionPool.Close() From 169d1433b3a022fba4e1d004349ab601a7269fd1 Mon Sep 17 00:00:00 2001 From: daniel <40469266+daniel-burghardt@users.noreply.github.com> Date: Thu, 9 May 2024 15:32:10 -0300 Subject: [PATCH 11/18] test 5 --- .github/workflows/go.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 6a16347..9f5ff14 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -76,11 +76,13 @@ jobs: ports: - 5432:5432 env: - PGUSER: postgres - PGPASSWORD: postgres PGHOST: localhost PGPORT: 5432 + PGUSER: postgres + PGPASSWORD: postgres + PGDATABASE: postgres DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable + steps: - name: Checkout uses: actions/checkout@v4 From 0347376523279792a10ca279c0e43d2b6cf7b996 Mon Sep 17 00:00:00 2001 From: daniel <40469266+daniel-burghardt@users.noreply.github.com> Date: Thu, 9 May 2024 15:41:27 -0300 Subject: [PATCH 12/18] test 6 --- go.mod | 2 +- go.sum | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index f7381f8..57649fb 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/rubenv/sql-migrate v1.6.1 github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.8.0 - github.com/stellar/go v0.0.0-20240417192451-c63ad05d3e3b + github.com/stellar/go v0.0.0-20231212225359-bc7173e667a6 github.com/stretchr/testify v1.9.0 ) diff --git a/go.sum b/go.sum index bc3d13b..ca35e18 100644 --- a/go.sum +++ b/go.sum @@ -130,8 +130,8 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v0.0.0-20160401233042-9235644dd9e5 h1:oERTZ1buOUYlpmKaqlO5fYmz8cZ1rYu5DieJzF4ZVmU= github.com/google/go-querystring v0.0.0-20160401233042-9235644dd9e5/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -256,8 +256,8 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI= github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI= -github.com/stellar/go v0.0.0-20240417192451-c63ad05d3e3b h1:oKqqeJBLfSe5NkFjYb1vacvxbw0NQr+j14NYVWvUkiA= -github.com/stellar/go v0.0.0-20240417192451-c63ad05d3e3b/go.mod h1:ckzsX0B0qfTMVZQJtPELJLs7cJ6xXMYHPVLyIsReGsU= +github.com/stellar/go v0.0.0-20231212225359-bc7173e667a6 h1:LcQ01nwgxVoCmzAthjGSbxun9z/mxuqDy4uYETw4jEQ= +github.com/stellar/go v0.0.0-20231212225359-bc7173e667a6/go.mod h1:PAWie4LYyDzJXqDVG4Qcj1Nt+uNk7sjzgSCXndQYsBA= github.com/stellar/go-xdr v0.0.0-20231122183749-b53fb00bcac2 h1:OzCVd0SV5qE3ZcDeSFCmOWLZfEWZ3Oe8KtmSOYKEVWE= github.com/stellar/go-xdr v0.0.0-20231122183749-b53fb00bcac2/go.mod h1:yoxyU/M8nl9LKeWIoBrbDPQ7Cy+4jxRcWcOayZ4BMps= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -380,8 +380,8 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= From b09ec7d86289b1a7f3260929b2e223fba4c52605 Mon Sep 17 00:00:00 2001 From: daniel <40469266+daniel-burghardt@users.noreply.github.com> Date: Thu, 9 May 2024 15:45:31 -0300 Subject: [PATCH 13/18] test 9 --- .github/workflows/go.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 9f5ff14..2a8c8ec 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -62,7 +62,7 @@ jobs: runs-on: ubuntu-latest services: postgres: - image: postgres:16-alpine + image: postgres:12-alpine env: POSTGRES_USER: postgres POSTGRES_DB: postgres From 815bace83c02837faae6580f077e6dd54619a014 Mon Sep 17 00:00:00 2001 From: daniel <40469266+daniel-burghardt@users.noreply.github.com> Date: Thu, 9 May 2024 15:48:16 -0300 Subject: [PATCH 14/18] test 7 --- .github/workflows/go.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 2a8c8ec..8b4f66e 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -90,7 +90,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.22" + go-version: "1.22.1" - name: Run Tests run: go test -v -race -cover ./... From 4e6e7cb938b00911b3363ab14440e181f1e75e5c Mon Sep 17 00:00:00 2001 From: daniel <40469266+daniel-burghardt@users.noreply.github.com> Date: Thu, 9 May 2024 15:53:04 -0300 Subject: [PATCH 15/18] test 8 --- .github/workflows/go.yaml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 8b4f66e..4bf1ce3 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -62,11 +62,10 @@ jobs: runs-on: ubuntu-latest services: postgres: - image: postgres:12-alpine + image: postgres:16-alpine env: - POSTGRES_USER: postgres - POSTGRES_DB: postgres - POSTGRES_PASSWORD: postgres + POSTGRES_HOST_AUTH_METHOD: trust + POSTGRES_DB: wallet-backend PGHOST: localhost options: >- --health-cmd pg_isready @@ -78,10 +77,7 @@ jobs: env: PGHOST: localhost PGPORT: 5432 - PGUSER: postgres - PGPASSWORD: postgres - PGDATABASE: postgres - DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable + DATABASE_URL: postgres://postgres@localhost:5432/wallet-backend?sslmode=disable steps: - name: Checkout @@ -90,7 +86,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.22.1" + go-version: "1.22.2" - name: Run Tests run: go test -v -race -cover ./... From 97b621588bc33ea6678529e34899666cbead01b1 Mon Sep 17 00:00:00 2001 From: daniel <40469266+daniel-burghardt@users.noreply.github.com> Date: Thu, 9 May 2024 15:54:44 -0300 Subject: [PATCH 16/18] test 10 --- .github/workflows/go.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 4bf1ce3..0f31a27 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -86,7 +86,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.22.2" + go-version: "1.22.1" - name: Run Tests run: go test -v -race -cover ./... From b8ac9e52a3d921dc9dd3bcdafcd049a89e4f0524 Mon Sep 17 00:00:00 2001 From: daniel <40469266+daniel-burghardt@users.noreply.github.com> Date: Thu, 9 May 2024 15:56:46 -0300 Subject: [PATCH 17/18] test 11 --- .github/workflows/go.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 0f31a27..03b7dbf 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -87,6 +87,8 @@ jobs: uses: actions/setup-go@v5 with: go-version: "1.22.1" + cache: true + cache-dependency-path: go.sum - name: Run Tests run: go test -v -race -cover ./... From c0f2116b9e7d1fac19c54a3cdff5e960cd04f12f Mon Sep 17 00:00:00 2001 From: daniel <40469266+daniel-burghardt@users.noreply.github.com> Date: Thu, 9 May 2024 15:59:20 -0300 Subject: [PATCH 18/18] test 12 --- .github/workflows/go.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 03b7dbf..eaa294c 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -64,8 +64,9 @@ jobs: postgres: image: postgres:16-alpine env: - POSTGRES_HOST_AUTH_METHOD: trust - POSTGRES_DB: wallet-backend + POSTGRES_USER: postgres + POSTGRES_DB: postgres + POSTGRES_PASSWORD: postgres PGHOST: localhost options: >- --health-cmd pg_isready @@ -77,7 +78,10 @@ jobs: env: PGHOST: localhost PGPORT: 5432 - DATABASE_URL: postgres://postgres@localhost:5432/wallet-backend?sslmode=disable + PGUSER: postgres + PGPASSWORD: postgres + PGDATABASE: postgres + DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable steps: - name: Checkout @@ -87,8 +91,6 @@ jobs: uses: actions/setup-go@v5 with: go-version: "1.22.1" - cache: true - cache-dependency-path: go.sum - name: Run Tests run: go test -v -race -cover ./...