In this repo, there are building functios like below(NewUsecase or NewRepository)
type mysqlArticleRepository struct {
Conn *sql.DB
}
// NewMysqlArticleRepository will create an object that represent the article.Repository interface
func NewMysqlArticleRepository(Conn *sql.DB) domain.ArticleRepository {
return &mysqlArticleRepository{Conn}
}
As you can see, it returns address using &mysqlArticleRepository which of data type is a pointer.
So I think return type should be pointer *domain.ArticleRepository like below
type mysqlArticleRepository struct {
Conn *sql.DB
}
// NewMysqlArticleRepository will create an object that represent the article.Repository interface
func NewMysqlArticleRepository(Conn *sql.DB) *domain.ArticleRepository {
return &mysqlArticleRepository{Conn}
}
I want to hear what you guys think about this.
Thanks for reading this issue. 😄
In this repo, there are building functios like below(NewUsecase or NewRepository)
As you can see, it returns address using
&mysqlArticleRepository
which of data type is a pointer. So I think return type should be pointer*domain.ArticleRepository
like belowI want to hear what you guys think about this. Thanks for reading this issue. 😄