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

Cut down on ganglia boilerplate

Open athomason opened this issue 9 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