diff --git a/httpclient.go b/httpclient.go index 9bec559..eedf49d 100644 --- a/httpclient.go +++ b/httpclient.go @@ -33,12 +33,12 @@ func httpPost(addr string, text string) error { } resp, err := httpClient.Post(addr, "text/plain", strings.NewReader(text)) - defer resp.Body.Close() // TODO: нужно ли закрывать Body при наличии ошибки? if err != nil { return err } + defer resp.Body.Close() - return nil // TODO: вернуть ошибку Post при наличии + return nil } func httpGet(addrFmt, jobName, text string) error { diff --git a/httpserver.go b/httpserver.go index 4f4e581..8a86a98 100644 --- a/httpserver.go +++ b/httpserver.go @@ -46,10 +46,10 @@ func handler(w http.ResponseWriter, r *http.Request) { job.NextLaunch = jobEntry.Next.Format(config.TimeFormat) jobs = append(jobs, job) } - templates.ExecuteTemplate(buf, "index.htm", jobs) + _ = templates.ExecuteTemplate(buf, "index.htm", jobs) globalMutex.RUnlock() - buf.WriteTo(w) + _, _ = buf.WriteTo(w) } func handleForceStart(w http.ResponseWriter, r *http.Request) { @@ -81,7 +81,7 @@ func handleForceStart(w http.ResponseWriter, r *http.Request) { func handleShutdown(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) - w.Write([]byte("Application terminated.\n")) + _, _ = w.Write([]byte("Application terminated.\n")) go func() { time.Sleep(time.Second) diff --git a/webui/details.htm b/webui/details.htm index 6e39272..8d6402c 100644 --- a/webui/details.htm +++ b/webui/details.htm @@ -23,7 +23,7 @@ Command -
{{.JobConfig.Command}}
+
{{if eq .JobConfig.Type 1}}{{.JobConfig.Command}}{{else if eq .JobConfig.Type 2}}{{.JobConfig.SqlText}}{{end}}
Status