chore: enable early-return from revive

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
Matthieu MOREL 2025-02-10 21:20:48 +01:00
parent b74cebf6bf
commit b472ce7010
10 changed files with 41 additions and 41 deletions

View file

@ -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{