mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2024-11-10 04:27:25 +01:00
Avoid one append
This commit is contained in:
parent
dc1e4f28a0
commit
e4285f02c5
@ -113,20 +113,20 @@ func (s *GangliaSink) Write(point lp.CCMetric) error {
|
|||||||
if k == "value" {
|
if k == "value" {
|
||||||
switch value := v.(type) {
|
switch value := v.(type) {
|
||||||
case float64:
|
case float64:
|
||||||
argstr = append(argstr, fmt.Sprintf("--value=%v", value))
|
argstr = append(argstr,
|
||||||
argstr = append(argstr, "--type=double")
|
fmt.Sprintf("--value=%v", value), "--type=double")
|
||||||
case float32:
|
case float32:
|
||||||
argstr = append(argstr, fmt.Sprintf("--value=%v", value))
|
argstr = append(argstr,
|
||||||
argstr = append(argstr, "--type=float")
|
fmt.Sprintf("--value=%v", value), "--type=float")
|
||||||
case int:
|
case int:
|
||||||
argstr = append(argstr, fmt.Sprintf("--value=%d", value))
|
argstr = append(argstr,
|
||||||
argstr = append(argstr, "--type=int32")
|
fmt.Sprintf("--value=%d", value), "--type=int32")
|
||||||
case int64:
|
case int64:
|
||||||
argstr = append(argstr, fmt.Sprintf("--value=%d", value))
|
argstr = append(argstr,
|
||||||
argstr = append(argstr, "--type=int32")
|
fmt.Sprintf("--value=%d", value), "--type=int32")
|
||||||
case string:
|
case string:
|
||||||
argstr = append(argstr, fmt.Sprintf("--value=%q", value))
|
argstr = append(argstr,
|
||||||
argstr = append(argstr, "--type=string")
|
fmt.Sprintf("--value=%q", value), "--type=string")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user