Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jmelahman committed Dec 25, 2024
1 parent 52d9a4d commit 53a4bf0
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,6 @@ type Sound struct {
url string
}

type readCloserWrapper struct {
io.Reader
closer io.Closer
}

func (rc *readCloserWrapper) Close() error {
return rc.closer.Close()
}

type ProgressReader struct {
Reader io.Reader
TotalSize int64
Expand Down Expand Up @@ -140,10 +131,7 @@ func downloadFileWithProgress(url, filepath string) error {
return fmt.Errorf("bad status: %s", resp.Status)
}

contentLength, err := strconv.Atoi(resp.Header.Get("Content-Length"))
if err != nil || contentLength <= 0 {
// We don't always get the Content-Length ahead of time and thus is life.
}
contentLength, _ := strconv.Atoi(resp.Header.Get("Content-Length"))

progressReader := &ProgressReader{
Reader: resp.Body,
Expand Down Expand Up @@ -336,10 +324,8 @@ func main() {
defer file.Close()
defer stream.Close()

err = saveNowPlaying(dataDir, nowPlaying)
if err != nil {
// TODO: Warn on error.
}
// TODO: Warn on error.
_ = saveNowPlaying(dataDir, nowPlaying)

if err := keyboard.Open(); err != nil {
log.Fatal("Error opening keyboard: ", err)
Expand Down Expand Up @@ -401,10 +387,8 @@ func main() {
nowPlaying = sounds[soundIndex]
}

err = saveNowPlaying(dataDir, nowPlaying)
if err != nil {
// TODO: Warn on error.
}
// TODO: Warn on error.
_ = saveNowPlaying(dataDir, nowPlaying)

if err := keyboard.Open(); err != nil {
log.Fatal("Error opening keyboard: ", err)
Expand Down

0 comments on commit 53a4bf0

Please sign in to comment.