From e8e3570a8f2df746f13fdb01fe1f4caff735b295 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Mon, 19 Sep 2022 01:32:23 +0400 Subject: [PATCH] Liquidsoap code moved to radio package. ErrNotRunning -> ErrLiquidsoapNotRunning. --- internal/radio/{liquidsoap => }/liquidsoap.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename internal/radio/{liquidsoap => }/liquidsoap.go (83%) diff --git a/internal/radio/liquidsoap/liquidsoap.go b/internal/radio/liquidsoap.go similarity index 83% rename from internal/radio/liquidsoap/liquidsoap.go rename to internal/radio/liquidsoap.go index eaa4ed3..4417e3b 100644 --- a/internal/radio/liquidsoap/liquidsoap.go +++ b/internal/radio/liquidsoap.go @@ -1,4 +1,4 @@ -package liquidsoap +package radio import ( "os/exec" @@ -7,7 +7,7 @@ import ( "github.com/pkg/errors" ) -var ErrNotRunning = errors.New("liquidsoap is not running") +var ErrLiquidsoapNotRunning = errors.New("liquidsoap is not running") type Liquidsoap struct { command *exec.Cmd @@ -20,7 +20,7 @@ func NewLiquidsoap(liquidsoapPath, scriptPath string) (*Liquidsoap, error) { out, err := exec.Command(liquidsoapPath, "--verbose", "-c", scriptPath).CombinedOutput() if err != nil { - return nil, errors.Wrap(err, "cannot check script") + return nil, errors.Wrap(err, "script cannot be validated") } if len(out) > 0 { @@ -39,7 +39,7 @@ func NewLiquidsoap(liquidsoapPath, scriptPath string) (*Liquidsoap, error) { func (l *Liquidsoap) Stop() error { if l.command.Process == nil && l.command.ProcessState != nil { - return ErrNotRunning + return ErrLiquidsoapNotRunning } if err := l.command.Process.Signal(syscall.SIGINT); err != nil {