mirror of
https://blitiri.com.ar/repos/chasquid
synced 2026-10-29 15:02:30 +00:00
Apply more mechanical simplifications using recent Go features
This is a follow-up on the `go fix` run in commit
0210c5fd92.
That commit recorded the automated updates.
This one applies further simplifications that are mechanical and do not
involve logic changes, but are outside of what `go fix` did.
It also removes some now-obsolete comments and statements.
This commit is contained in:
@@ -27,7 +27,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"sort"
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
@@ -90,8 +90,8 @@ func MetricsHandler(w http.ResponseWriter, r *http.Request) {
|
||||
})
|
||||
|
||||
// Sort the variables for reproducibility and readability.
|
||||
sort.Slice(vars, func(i, j int) bool {
|
||||
return vars[i].Name < vars[j].Name
|
||||
slices.SortFunc(vars, func(a, b exportedVar) int {
|
||||
return strings.Compare(a.Name, b.Name)
|
||||
})
|
||||
|
||||
for _, v := range vars {
|
||||
|
||||
Reference in New Issue
Block a user