gofr-dev / gofr

An opinionated GoLang framework for accelerated microservice development. Built in support for databases and observability.
https://gofr.dev
Apache License 2.0
3.61k stars 244 forks source link

Tracer, debugger: refactoring to reduce boilerplate #1244

Open ccoVeille opened 4 days ago

ccoVeille commented 4 days ago

I thi k it's important to avoid the boilerplate we have everywhere. I mean code that is copy pasted and is pain to fix like https://github.com/gofr-dev/gofr/pull/1214

I think about a short lived struct. Based in what have been done with #1235.

In other frameworks it would be a middleware that is added on demand, without interference with the code.

I'm unsure how easy it would be to consider a middleware

Originally posted by @ccoVeille in https://github.com/gofr-dev/gofr/pull/1235#issuecomment-2503029809

The struct could be created via a constructor, that will return a closer func.

I'm unsure yet if it should create the span or not.