feat(ci): add a bunch more linters

This commit is contained in:
sentriz
2023-09-22 19:05:20 +02:00
parent 33f1f2e0cf
commit e3dd812b6c
37 changed files with 233 additions and 139 deletions

View File

@@ -11,8 +11,10 @@ import (
"go.senan.xyz/gonic/jukebox"
)
func newJukebox(t *testing.T) *jukebox.Jukebox {
sockPath := filepath.Join(t.TempDir(), "mpv.sock")
func newJukebox(tb testing.TB) *jukebox.Jukebox {
tb.Helper()
sockPath := filepath.Join(tb.TempDir(), "mpv.sock")
j := jukebox.New()
err := j.Start(
@@ -20,12 +22,12 @@ func newJukebox(t *testing.T) *jukebox.Jukebox {
[]string{jukebox.MPVArg("--ao", "null")},
)
if errors.Is(err, jukebox.ErrMPVTooOld) {
t.Skip("old mpv found, skipping")
tb.Skip("old mpv found, skipping")
}
if err != nil {
t.Fatalf("start jukebox: %v", err)
tb.Fatalf("start jukebox: %v", err)
}
t.Cleanup(func() {
tb.Cleanup(func() {
j.Quit()
})
return j