mirror of
https://github.com/prometheus/prometheus.git
synced 2025-07-03 11:03:25 +00:00
chore: enable early-return from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
parent
b74cebf6bf
commit
b472ce7010
10 changed files with 41 additions and 41 deletions
|
@ -288,11 +288,11 @@ func valuesToSamples(timestamp time.Time, value interface{}) (prompb.Sample, err
|
|||
var valueInt64 int64
|
||||
var ok bool
|
||||
if valueFloat64, ok = value.(float64); !ok {
|
||||
if valueInt64, ok = value.(int64); ok {
|
||||
valueFloat64 = float64(valueInt64)
|
||||
} else {
|
||||
valueInt64, ok = value.(int64)
|
||||
if !ok {
|
||||
return prompb.Sample{}, fmt.Errorf("unable to convert sample value to float64: %v", value)
|
||||
}
|
||||
valueFloat64 = float64(valueInt64)
|
||||
}
|
||||
|
||||
return prompb.Sample{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue