build: add even more linting rules

Notably, shorten function signatures by not repeating types.
This commit is contained in:
Vincent Bernat
2025-11-12 22:43:12 +01:00
parent 7f5950f89c
commit beb9a3f0ba
12 changed files with 20 additions and 17 deletions

View File

@@ -152,9 +152,6 @@ func (c *Component) widgetTopHandlerFunc(gc *gin.Context) {
}
switch uriParams.WidgetName {
default:
gc.JSON(http.StatusNotFound, gin.H{"message": "Unknown top request."})
return
case HomepageTopWidgetSrcAS:
selector = fmt.Sprintf(`concat(toString(SrcAS), ': ', dictGetOrDefault('%s', 'name', SrcAS, '???'))`, schema.DictionaryASNs)
groupby = `SrcAS`
@@ -181,6 +178,9 @@ func (c *Component) widgetTopHandlerFunc(gc *gin.Context) {
selector = fmt.Sprintf(`concat(dictGetOrDefault('%s', 'name', Proto, '???'), '/', toString(DstPort))`, schema.DictionaryProtocols)
groupby = `Proto, DstPort`
mainTableRequired = true
default:
gc.JSON(http.StatusNotFound, gin.H{"message": "Unknown top request."})
return
}
if strings.HasPrefix(gc.Param("name"), "src-") {
filter = "AND InIfBoundary = 'external'"