Skip to content

Commit

Permalink
fix: module name (#11)
Browse files Browse the repository at this point in the history
What
Rename the module to follow Go mod recommendations.

> The module's module path, usually the repository location from which the module can be downloaded by Go tools

Why
Follow the best practices.
  • Loading branch information
CaioTeixeira95 authored May 20, 2024
1 parent 067eb26 commit b385072
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package cmd

import (
"go/types"
"wallet-backend/internal/serve"

_ "github.com/lib/pq"
"github.com/spf13/cobra"
"github.com/stellar/go/support/config"
supportlog "github.com/stellar/go/support/log"
"github.com/stellar/wallet-backend/internal/serve"
)

type serveCmd struct {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module wallet-backend
module github.com/stellar/wallet-backend

go 1.22.0

Expand Down
3 changes: 2 additions & 1 deletion internal/data/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package data

import (
"errors"
"wallet-backend/internal/db"

"github.com/stellar/wallet-backend/internal/db"
)

type Models struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/data/payments.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package data

import (
"context"
"wallet-backend/internal/db"

"github.com/stellar/go/support/errors"
"github.com/stellar/wallet-backend/internal/db"
)

type PaymentModel struct {
Expand Down
4 changes: 2 additions & 2 deletions internal/data/payments_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"context"
"database/sql"
"testing"
"wallet-backend/internal/db"
"wallet-backend/internal/db/dbtest"

"github.com/stellar/go/keypair"
"github.com/stellar/wallet-backend/internal/db"
"github.com/stellar/wallet-backend/internal/db/dbtest"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/db/dbtest/dbtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package dbtest
import (
"net/http"
"testing"
"wallet-backend/internal/db/migrations"

migrate "github.com/rubenv/sql-migrate"
"github.com/stellar/go/support/db/dbtest"
"github.com/stellar/go/support/db/schema"
"github.com/stellar/wallet-backend/internal/db/migrations"
)

func Open(t *testing.T) *dbtest.DB {
Expand Down
4 changes: 2 additions & 2 deletions internal/serve/httphandler/payments_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package httphandler

import (
"net/http"
"wallet-backend/internal/data"
"wallet-backend/internal/serve/httperror"

"github.com/stellar/go/support/http/httpdecode"
"github.com/stellar/wallet-backend/internal/data"
"github.com/stellar/wallet-backend/internal/serve/httperror"
)

type PaymentsHandler struct {
Expand Down
7 changes: 3 additions & 4 deletions internal/serve/httphandler/payments_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ import (
"net/http/httptest"
"strings"
"testing"
"wallet-backend/internal/data"
"wallet-backend/internal/db/dbtest"

"wallet-backend/internal/db"

"github.com/go-chi/chi"
"github.com/stellar/go/keypair"
"github.com/stellar/wallet-backend/internal/data"
"github.com/stellar/wallet-backend/internal/db"
"github.com/stellar/wallet-backend/internal/db/dbtest"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
9 changes: 4 additions & 5 deletions internal/serve/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ import (
"fmt"
"net/http"

"wallet-backend/internal/data"
"wallet-backend/internal/db"
"wallet-backend/internal/serve/httperror"
"wallet-backend/internal/serve/httphandler"

"github.com/go-chi/chi"
"github.com/pkg/errors"
supporthttp "github.com/stellar/go/support/http"
supportlog "github.com/stellar/go/support/log"
"github.com/stellar/go/support/render/health"
"github.com/stellar/wallet-backend/internal/data"
"github.com/stellar/wallet-backend/internal/db"
"github.com/stellar/wallet-backend/internal/serve/httperror"
"github.com/stellar/wallet-backend/internal/serve/httphandler"
)

type Configs struct {
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import "wallet-backend/cmd"
import "github.com/stellar/wallet-backend/cmd"

func main() {
cmd.Execute()
Expand Down

0 comments on commit b385072

Please sign in to comment.