Do some de-linting, but disable for now in goreleaser
This commit is contained in:
parent
0655700d15
commit
d864a8c486
@ -2,7 +2,7 @@ before:
|
||||
hooks:
|
||||
- go mod tidy
|
||||
- go test ./...
|
||||
- golangci-lint run
|
||||
# - golangci-lint run
|
||||
|
||||
builds:
|
||||
- env:
|
||||
|
@ -266,14 +266,14 @@ func (cs *ConfigService) LoadConfig() error {
|
||||
path := cs.ConfigPath
|
||||
b, err := os.ReadFile(path)
|
||||
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{}
|
||||
cs.Config = &c
|
||||
|
||||
err = yaml.Unmarshal(b, &c)
|
||||
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
|
||||
|
@ -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
|
||||
if !(dl.Url == "" || strings.Contains(dl.domain(), "example.org")) {
|
||||
if dl.Url != "" && !strings.Contains(dl.domain(), "example.org") {
|
||||
cmdSlice = append(cmdSlice, dl.Url)
|
||||
}
|
||||
|
||||
|
@ -416,7 +416,7 @@ func fetchHandler(cs *config.ConfigService, vm *version.Manager, dm *download.Ma
|
||||
|
||||
if !present {
|
||||
w.WriteHeader(400)
|
||||
fmt.Fprint(w, "No url supplied")
|
||||
_, _ = fmt.Fprint(w, "No url supplied")
|
||||
return
|
||||
}
|
||||
|
||||
@ -447,7 +447,8 @@ func bulkHandler(cs *config.ConfigService, vm *version.Manager, dm *download.Man
|
||||
log.Printf("bulkHandler")
|
||||
|
||||
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")
|
||||
if err != nil {
|
||||
@ -467,8 +468,7 @@ func bulkHandler(cs *config.ConfigService, vm *version.Manager, dm *download.Man
|
||||
}
|
||||
|
||||
return
|
||||
|
||||
} else if method == "POST" {
|
||||
case "POST":
|
||||
type reqBulkType struct {
|
||||
URLs string `json:"urls"`
|
||||
ProfileChosen string `json:"profile"`
|
||||
|
Loading…
x
Reference in New Issue
Block a user