Amazig tutorial video! I had to make a small change to the be able to mass my test. I had to specifically get the basePath in handler test. and use "api/account/me" instead just "/me" when creating new request
Hay bro, I think if we follow clean arch we shouldn't send gin.Context to Service because anythings about framework should end at the first layer of our application (in this case gin.Context should not go any further than handler). However, I see you pass gin.Context as a context(gin.Context satisfies go's context.Context) but is it have a better way? like sending model instead of context?
That makes sense. I later make some updates (I think in the "Fixes" video) and extract a regular Go Context (from package context) from the gin context, using c. Request().Context(), and forward this to the service and repository layers instead of the gin context. I see this in done in other examples, and this is the reason context exists, to my best understanding. I could be wrong. This popular clean architecture demo uses the pattern of forwarding the request context... github.com/bxcodec/go-clean-arch Some libraries I believe can cancel this context, which we could then handle in our app. Or we could timeout the context of processes take too long. Later on, we create a middleware to timeout handlers, and in the middleware I make sure to set a timeout on the request context belonging to the gin context. Thanks for the feedback. I'm still learning a lot and even though I built the initial application sometime ago, I'm seeing ways to improve all the time.
You are a god of teaching! Have 1 question. I don't understand ret.Get(0).(*model.user) why do use brackets and why don't you cast r0 instead of *model.user ?
Amazig tutorial video! I had to make a small change to the be able to mass my test. I had to specifically get the basePath in handler test. and use "api/account/me" instead just "/me" when creating new request
Thanks, bro!. This is a huge job and can help everyone that sees your craft.
Thanks for the complements. I'm learning as I go like everyone else, but am glad my progress was useful for you! :)
Most effective series I ve ever seen
JUST which was looking for!!, thanks very much bro!
Hay bro, I think if we follow clean arch we shouldn't send gin.Context to Service because anythings about framework should end at the first layer of our application (in this case gin.Context should not go any further than handler). However, I see you pass gin.Context as a context(gin.Context satisfies go's context.Context) but is it have a better way? like sending model instead of context?
That makes sense.
I later make some updates (I think in the "Fixes" video) and extract a regular Go Context (from package context) from the gin context, using c. Request().Context(), and forward this to the service and repository layers instead of the gin context.
I see this in done in other examples, and this is the reason context exists, to my best understanding. I could be wrong. This popular clean architecture demo uses the pattern of forwarding the request context...
github.com/bxcodec/go-clean-arch
Some libraries I believe can cancel this context, which we could then handle in our app. Or we could timeout the context of processes take too long.
Later on, we create a middleware to timeout handlers, and in the middleware I make sure to set a timeout on the request context belonging to the gin context.
Thanks for the feedback. I'm still learning a lot and even though I built the initial application sometime ago, I'm seeing ways to improve all the time.
You are a god of teaching!
Have 1 question.
I don't understand ret.Get(0).(*model.user)
why do use brackets and why don't you cast r0 instead of *model.user ?
Hi. Thank you for the tutorial.
What extension do you use for such nice color folders in VSCode?
can be given .vscode or .devcontainer or dev.Dockerfile
I use devcontainer, so as not to litter wsl 2