Do some de-linting, but disable for now in goreleaser

This commit is contained in:
Justin Hawkins 2025-04-25 11:13:48 +09:30
parent 0655700d15
commit d864a8c486
4 changed files with 8 additions and 8 deletions

View File

@ -2,7 +2,7 @@ before:
hooks: hooks:
- go mod tidy - go mod tidy
- go test ./... - go test ./...
- golangci-lint run # - golangci-lint run
builds: builds:
- env: - env:

View File

@ -266,14 +266,14 @@ func (cs *ConfigService) LoadConfig() error {
path := cs.ConfigPath path := cs.ConfigPath
b, err := os.ReadFile(path) b, err := os.ReadFile(path)
if err != nil { if err != nil {
return fmt.Errorf("Could not read config '%s': %v", path, err) return fmt.Errorf("could not read config '%s': %v", path, err)
} }
c := Config{} c := Config{}
cs.Config = &c cs.Config = &c
err = yaml.Unmarshal(b, &c) err = yaml.Unmarshal(b, &c)
if err != nil { if err != nil {
return fmt.Errorf("Could not parse YAML config '%s': %v", path, err) return fmt.Errorf("could not parse YAML config '%s': %v", path, err)
} }
// do migrations // do migrations

View File

@ -277,7 +277,7 @@ func (dl *Download) Begin() {
} }
// only add the url if it's not empty or an example URL. This helps us with testing // only add the url if it's not empty or an example URL. This helps us with testing
if !(dl.Url == "" || strings.Contains(dl.domain(), "example.org")) { if dl.Url != "" && !strings.Contains(dl.domain(), "example.org") {
cmdSlice = append(cmdSlice, dl.Url) cmdSlice = append(cmdSlice, dl.Url)
} }

View File

@ -416,7 +416,7 @@ func fetchHandler(cs *config.ConfigService, vm *version.Manager, dm *download.Ma
if !present { if !present {
w.WriteHeader(400) w.WriteHeader(400)
fmt.Fprint(w, "No url supplied") _, _ = fmt.Fprint(w, "No url supplied")
return return
} }
@ -447,7 +447,8 @@ func bulkHandler(cs *config.ConfigService, vm *version.Manager, dm *download.Man
log.Printf("bulkHandler") log.Printf("bulkHandler")
method := r.Method method := r.Method
if method == "GET" { switch method {
case "GET":
t, err := template.ParseFS(webFS, "data/templates/layout.tmpl", "data/templates/menu.tmpl", "data/templates/bulk.tmpl") t, err := template.ParseFS(webFS, "data/templates/layout.tmpl", "data/templates/menu.tmpl", "data/templates/bulk.tmpl")
if err != nil { if err != nil {
@ -467,8 +468,7 @@ func bulkHandler(cs *config.ConfigService, vm *version.Manager, dm *download.Man
} }
return return
case "POST":
} else if method == "POST" {
type reqBulkType struct { type reqBulkType struct {
URLs string `json:"urls"` URLs string `json:"urls"`
ProfileChosen string `json:"profile"` ProfileChosen string `json:"profile"`