Skip to content

Commit

Permalink
♻️ refactoring: Now using refferences for the services and repositori…
Browse files Browse the repository at this point in the history
…es constructors
  • Loading branch information
kevinmarquesp committed Jul 31, 2024
1 parent 23843bf commit baab0a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions internal/repositories/sqlite_user_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ type SqliteUserRepository struct {
database *sql.DB
}

func NewSqliteUserRepository(path string) (SqliteUserRepository, error) {
func NewSqliteUserRepository(path string) (*SqliteUserRepository, error) {
connection, err := sql.Open("sqlite3", path)
if err != nil {
return SqliteUserRepository{}, err
return &SqliteUserRepository{}, err
}

return SqliteUserRepository{
return &SqliteUserRepository{
database: connection,
}, nil
}
Expand Down
4 changes: 2 additions & 2 deletions internal/services/service_authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ type GopostrAuthenticationService struct {
UserRepo repositories.UserRepository
}

func NewGopostrAuthenticationService(userRepo repositories.UserRepository) GopostrAuthenticationService {
return GopostrAuthenticationService{
func NewGopostrAuthenticationService(userRepo repositories.UserRepository) *GopostrAuthenticationService {
return &GopostrAuthenticationService{
UserRepo: userRepo,
}
}
Expand Down

0 comments on commit baab0a2

Please sign in to comment.