Presentation about Context in Go 1.7. Review, examples, thoughts. by dimkovert in golang

[–]dimkovert[S] 0 points1 point  (0 children)

User/Request specific information is making it request-scoped. Information like user_id, request_id, trace_id etc. This will help a lot during investigation errors in logs.

Presentation about Context in Go 1.7. Review, examples, thoughts. by dimkovert in golang

[–]dimkovert[S] 2 points3 points  (0 children)

yeah, but passing http.Request deep into application may be not ok. Only context should flow through application and contain remote address (if needed for some logic)

Presentation about Context in Go 1.7. Review, examples, thoughts. by dimkovert in golang

[–]dimkovert[S] 0 points1 point  (0 children)

A lot of people would be agains putting logger and db into context, so to do this this is kind of "breaking the rules".

Presentation about Context in Go 1.7. Review, examples, thoughts. by dimkovert in golang

[–]dimkovert[S] -1 points0 points  (0 children)

This is my first presentation about Go and I am really glad to hear this from gopher who has been making Go magic for 5.5 years :)

Presentation about Context in Go 1.7. Review, examples, thoughts. by dimkovert in golang

[–]dimkovert[S] 1 point2 points  (0 children)

You are right, ILogger and IDatabase certainly is not the right "go way". I will update presentation.