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
1 changed files with 6 additions and 6 deletions

View File

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