Skip to content

Commit 6a16eee

Browse files
committed
Fix linting issues
1 parent 067aeca commit 6a16eee

7 files changed

Lines changed: 12 additions & 0 deletions

File tree

internal/apidoc/spec.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ type entitySpec struct {
8383
internal bool
8484
}
8585

86+
//nolint:goconst
8687
var popularityEntities = []entitySpec{
8788
{
8889
basePath: "/api/packages",
@@ -151,6 +152,7 @@ var popularityEntities = []entitySpec{
151152
},
152153
}
153154

155+
//nolint:goconst
154156
var (
155157
paramStartMonth = Parameter{
156158
Name: "startMonth",
@@ -184,6 +186,7 @@ var (
184186
}
185187
)
186188

189+
//nolint:goconst
187190
func popularityItemSchema(identifierField string) *Schema {
188191
return &Schema{
189192
Type: "object",
@@ -230,6 +233,7 @@ func jsonResponse(schemaName string) map[string]Response {
230233
}
231234
}
232235

236+
//nolint:goconst
233237
func BuildSpec(includeInternal bool) *OpenAPISpec {
234238
spec := &OpenAPISpec{
235239
OpenAPI: "3.0.0",

internal/config/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"os"
88
)
99

10+
//nolint:goconst
1011
var defaultExpectedPackages = []string{"pkgstats", "pacman"}
1112

1213
type Config struct {

internal/submit/request.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ func validateArchitectures(systemArch, osArch string) error {
123123
return nil
124124
}
125125

126+
//nolint:goconst
126127
func getValidOSArchitectures(systemArch string) []string {
127128
switch systemArch {
128129
case archX86_64, "x86_64_v2", "x86_64_v3", "x86_64_v4":
@@ -148,6 +149,7 @@ func getValidOSArchitectures(systemArch string) []string {
148149
}
149150
}
150151

152+
//nolint:goconst
151153
func getValidSystemArchitectures(osArch string) []string {
152154
switch osArch {
153155
case archX86_64:

internal/ui/fundetail/handler.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ func (h *Handler) HandleFunDetail(w http.ResponseWriter, r *http.Request) {
3838
if category == nil {
3939
if expanded := expandCamelCase(categoryName); expanded != categoryName {
4040
if fun.FindCategory(expanded) != nil {
41+
//nolint:gosec // Target is prefixed and escaped
4142
http.Redirect(w, r, "/fun/"+url.PathEscape(expanded)+"/"+preset, http.StatusMovedPermanently)
4243
return
4344
}

internal/ui/home/schema.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package home
22

3+
//nolint:goconst
34
func webSiteSchema(baseURL string) any {
45
return map[string]any{
56
"@context": "https://schema.org",
@@ -14,6 +15,7 @@ func webSiteSchema(baseURL string) any {
1415
}
1516
}
1617

18+
//nolint:goconst
1719
func datasetSchema(baseURL string) any {
1820
return map[string]any{
1921
"@context": "https://schema.org",

internal/ui/legacy.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ func LegacyMiddleware(next http.Handler) http.Handler {
5050
target = strings.ReplaceAll(target, "{"+string(rune('0'+i))+"}", matches[i])
5151
}
5252

53+
//nolint:gosec // Target is hardcoded in legacyRoutes
5354
http.Redirect(w, r, target, http.StatusMovedPermanently)
5455
return
5556
}

internal/ui/systemarchitectures/handler.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ type preset struct {
2323
EndMonth int
2424
}
2525

26+
//nolint:goconst
2627
var presets = []preset{
2728
{
2829
Label: "current",

0 commit comments

Comments
 (0)