chore(audiobooks): drop unused parseBookmarkTime from bookmark handler
The helper was added in advance of the DELETE handler (next task in the plan) but is unused in this commit, which trips golangci-lint's unused check. Reintroduce it together with its first caller. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
815f207d6c
commit
29c40f448c
@@ -6,7 +6,6 @@ import (
|
||||
"log/slog"
|
||||
"math"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-chi/chi/v5"
|
||||
)
|
||||
@@ -95,16 +94,3 @@ func writeBookmarkList(w http.ResponseWriter, r *http.Request, h *Handler, userI
|
||||
writeJSON(w, http.StatusOK, out)
|
||||
}
|
||||
|
||||
// parseBookmarkTime parses the {time} URL parameter on DELETE
|
||||
// /me/item/{itemId}/bookmark/{time}. Returns (0, false) on parse
|
||||
// failure.
|
||||
func parseBookmarkTime(s string) (float64, bool) {
|
||||
if s == "" {
|
||||
return 0, false
|
||||
}
|
||||
v, err := strconv.ParseFloat(s, 64)
|
||||
if err != nil || math.IsNaN(v) {
|
||||
return 0, false
|
||||
}
|
||||
return v, true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user