Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
streambinder committed Sep 6, 2024
1 parent ba4b9eb commit e41e525
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 50 deletions.
2 changes: 1 addition & 1 deletion cmd/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ func routineCollect(ctx context.Context, ch chan error) {
// to the (meta)data fetched from upstream
func routineCollectAsset(track *entity.Track) func(context.Context, chan error) {
return func(ctx context.Context, ch chan error) {
tui.Lot("download").Printf(track.UpstreamURL)
tui.Lot("download").Print(track.UpstreamURL)
if err := downloader.Download(track.UpstreamURL, track.Path().Download(), nil); err != nil {
tui.AnchorPrintf("download failure: %s", err)
ch <- err
Expand Down
12 changes: 8 additions & 4 deletions util/anchor/lot.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,30 @@ func formatAlias(alias string) string {
return fmt.Sprintf("(%s) ", alias)
}

func (lot *lot) Printf(format string, a ...any) {
func (lot *lot) Print(message string) {
lot.window.lock.Lock()
defer lot.window.lock.Unlock()
defer cursor.Bottom()

lot.data = fmt.Sprintf(format, a...)
lot.data = message
lot.window.up(len(lot.window.lots))
for _, lot := range lot.window.lots {
lot.write()
lot.window.down()
}
}

func (lot *lot) Printf(format string, a ...any) {
lot.Print(fmt.Sprintf(format, a...))
}

func (lot *lot) Wipe() {
lot.Printf(idle)
lot.Print(idle)
}

func (lot *lot) Close(messages ...string) {
lot.style = color.New(color.FgWhite)
lot.Printf(util.First(messages, "done"))
lot.Print(util.First(messages, "done"))
}

func (lot *lot) write() {
Expand Down
19 changes: 0 additions & 19 deletions util/random.go

This file was deleted.

26 changes: 0 additions & 26 deletions util/random_test.go

This file was deleted.

0 comments on commit e41e525

Please sign in to comment.