Closed MutazAshhab closed 2 years ago
@Taz17 I suggest you to read https://threedots.tech/post/ddd-lite-in-go-introduction/.
Thank you, for everyone who is wondering what the answer would be its to reference a pointer to Article
in ArticleStats
type ArticleStats struct {
ID int64 `json:"id"`
Article *Article `json:"article"`
.
}
In
domain/article.go
we haveHere an
Author
attribute exists because anArticle
belongs to anAuthor
Going from that logic I attempted to add
ArticleStats
so I made the following changes:in
domain/article.go
and added
in
domain/articlestats.go
And I get
illegal cycle in declaration of Article
+illegal cycle in declaration of ArticleStats
How is this solved?