README update for sonarcloud badges, simplify some test code, fixed some sonarlint issues

This commit is contained in:
yusing
2024-09-17 04:51:26 +08:00
parent 409a18df38
commit 04fd6543fd
6 changed files with 106 additions and 87 deletions

View File

@@ -29,10 +29,10 @@ func List(cfg *config.Config, w http.ResponseWriter, r *http.Request) {
func listRoutes(cfg *config.Config, w http.ResponseWriter, r *http.Request) {
routes := cfg.RoutesByAlias()
type_filter := r.FormValue("type")
if type_filter != "" {
typeFilter := r.FormValue("type")
if typeFilter != "" {
for k, v := range routes {
if v["type"] != type_filter {
if v["type"] != typeFilter {
delete(routes, k)
}
}