mirror of
https://github.com/nxshock/promodj.git
synced 2024-11-27 03:01:01 +05:00
Resolve linter issues
This commit is contained in:
parent
fc684125cc
commit
87bc382747
@ -86,7 +86,7 @@ func handleGetM3u(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "audio/x-mpegurl")
|
||||
w.Header().Set("Accept-Ranges", "none")
|
||||
|
||||
w.Write(b)
|
||||
_, _ = w.Write(b)
|
||||
}
|
||||
|
||||
func handleStream(w http.ResponseWriter, r *http.Request) {
|
||||
|
17
parser.go
17
parser.go
@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
@ -40,7 +41,13 @@ func UpdateGenres() error {
|
||||
func updateGenreList() ([]Genre, error) {
|
||||
url := "https://promodj.com/music"
|
||||
|
||||
doc, err := goquery.NewDocument(url)
|
||||
resp, err := http.Get(url)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
doc, err := goquery.NewDocumentFromReader(resp.Body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -54,7 +61,13 @@ func updateGenreList() ([]Genre, error) {
|
||||
}
|
||||
|
||||
func parsePage(url string, resultsChan chan TrackInfo) {
|
||||
doc, err := goquery.NewDocument(url)
|
||||
resp, err := http.Get(url)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
doc, err := goquery.NewDocumentFromReader(resp.Body)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ func encode(url string, w io.Writer) error {
|
||||
buf := buffer.New(int64(config.BufferSize) * 1024 * 1024)
|
||||
_, err = nio.Copy(w, out, buf)
|
||||
if err != nil {
|
||||
cmd.Process.Kill()
|
||||
_ = cmd.Process.Kill()
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user