(v expvar.Var)
| 202 | } |
| 203 | |
| 204 | func parseExpvarFloat(v expvar.Var) (float64, bool) { |
| 205 | switch val := v.(type) { |
| 206 | case *expvar.Int: |
| 207 | return float64(val.Value()), true |
| 208 | case *expvar.Float: |
| 209 | return val.Value(), true |
| 210 | default: |
| 211 | f, err := strconv.ParseFloat(v.String(), 64) |
| 212 | return f, err == nil |
| 213 | } |
| 214 | } |
no test coverage detected