From 1c5fc2e4364063884f33b78f45f351201705fae4 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Thu, 27 Aug 2026 11:32:31 +0200 Subject: Tame the deadcode gate and remove dead web helpers Run deadcode with -test and without the vendored node_modules package so the check reports only genuinely unreachable code instead of test-only helpers and vendored functions. Remove the three web helpers it still flagged (formatBikeType, formatRideType, dataQualityURL) that had no callers. Apply the go fix modernizations the check gate performs (range-over-int loops and embedded-field composite literals) that the gate had rewritten in the working tree. --- web/categories.go | 14 -------------- web/data_quality.go | 4 ---- 2 files changed, 18 deletions(-) (limited to 'web') diff --git a/web/categories.go b/web/categories.go index 4077092..a76fa1c 100644 --- a/web/categories.go +++ b/web/categories.go @@ -67,20 +67,6 @@ var rideTypeLabels = map[ride.RideType]string{ ride.RideTypeTransport: "Transport", } -func formatBikeType(value ride.BikeType) string { - if label, ok := bikeTypeLabels[value]; ok { - return label - } - return string(value) -} - -func formatRideType(value ride.RideType) string { - if label, ok := rideTypeLabels[value]; ok { - return label - } - return string(value) -} - func formatCategoryOrEmpty(value string) string { if value == "" { return "—" diff --git a/web/data_quality.go b/web/data_quality.go index 74e84af..562ecf8 100644 --- a/web/data_quality.go +++ b/web/data_quality.go @@ -86,10 +86,6 @@ func dataQualityNotice(r *http.Request) string { return "" } -func dataQualityURL() string { - return "/data-quality" -} - type DataQualityPageData struct { Items []RideView Total int -- cgit v1.3