diff --git a/cmd/compile.go b/cmd/compile.go index 62308e9..c30e643 100644 --- a/cmd/compile.go +++ b/cmd/compile.go @@ -44,6 +44,8 @@ var compileCmd = &cobra.Command{ return err } m.RootFS.AddData(dest, data) + default: + return fmt.Errorf("unknown instruction: %s", parts[0]) } } diff --git a/cmd/run_test.go b/cmd/run_test.go index 4b93c09..7357ecf 100644 --- a/cmd/run_test.go +++ b/cmd/run_test.go @@ -65,7 +65,11 @@ func TestRunCmd_Good(t *testing.T) { } // Mock the exec.Command function. + origExecCommand := execCommand execCommand = helperProcess + t.Cleanup(func() { + execCommand = origExecCommand + }) // Run the run command. rootCmd := NewRootCmd() diff --git a/pkg/matrix/matrix_test.go b/pkg/matrix/matrix_test.go index 6c6567c..25013f4 100644 --- a/pkg/matrix/matrix_test.go +++ b/pkg/matrix/matrix_test.go @@ -3,6 +3,7 @@ package matrix import ( "archive/tar" "bytes" + "io" "testing" "github.com/Snider/Borg/pkg/datanode" @@ -60,7 +61,7 @@ func TestToTar(t *testing.T) { for { header, err := tr.Next() if err != nil { - if err.Error() == "EOF" { + if err == io.EOF { break } t.Fatalf("failed to read tar header: %v", err)