Remove unnecessary "else" branch in query API.

This commit is contained in:
Julius Volz 2015-03-21 17:54:30 +01:00
parent a68b880c27
commit df314ead84

View file

@ -43,13 +43,13 @@ func setAccessControlHeaders(w http.ResponseWriter) {
func parseTimestampOrNow(t string) (clientmodel.Timestamp, error) {
if t == "" {
return clientmodel.Now(), nil
} else {
tFloat, err := strconv.ParseFloat(t, 64)
if err != nil {
return 0, err
}
return clientmodel.TimestampFromUnixNano(int64(tFloat * float64(time.Second/time.Nanosecond))), nil
}
tFloat, err := strconv.ParseFloat(t, 64)
if err != nil {
return 0, err
}
return clientmodel.TimestampFromUnixNano(int64(tFloat * float64(time.Second/time.Nanosecond))), nil
}
func parseDuration(d string) (time.Duration, error) {