go-utils icon indicating copy to clipboard operation
go-utils copied to clipboard

Cut down on ganglia boilerplate

Open athomason opened this issue 10 years ago • 2 comments

gmetric.MetricSender takes a value string which has led to a lot of line noise in the places we use it. That could be cut way down by making value an interface{}; a type switch that handles string, fmt.Stringer and the various int types would get rid of the excess of String() and strconv.*() calls. Floats are trickier since the appropriate rendering varies, but I guess we could supply a default like %.3f; callers can obviously still do their own sprintfing when necessary. Thoughts?

athomason avatar Jul 30 '14 21:07 athomason

:+1:

We should also consider refactoring go-utils at some point so that the API isn't so all over the place.

twmb avatar Jul 30 '14 22:07 twmb

It would make make my life better.

sfjuggernaut avatar Jul 30 '14 22:07 sfjuggernaut