From cafee064de35a50a76fa4f8e004c71c542837208 Mon Sep 17 00:00:00 2001 From: Joseph Kato Date: Sat, 18 May 2024 17:47:59 -0700 Subject: [PATCH] refactor: fix `callRst` on Windows --- internal/lint/rst.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/internal/lint/rst.go b/internal/lint/rst.go index a67a9947..6bea5593 100644 --- a/internal/lint/rst.go +++ b/internal/lint/rst.go @@ -5,7 +5,6 @@ import ( "errors" "os/exec" "regexp" - "runtime" "strings" "github.com/errata-ai/vale/v3/internal/core" @@ -60,17 +59,10 @@ func (l *Linter) lintRST(f *core.File) error { return l.lintHTMLTokens(f, []byte(html), 0) } -func callRst(text, lib, exe string) (string, error) { +func callRst(text, lib, _ string) (string, error) { var out bytes.Buffer - var cmd *exec.Cmd - - if strings.HasPrefix(runtime.GOOS, "windows") { - // rst2html is executable by default on Windows. - cmd = exec.Command(exe, append([]string{lib}, rstArgs...)...) //nolint:gosec - } else { - cmd = exec.Command(lib, rstArgs...) - } + cmd := exec.Command(lib, rstArgs...) cmd.Stdin = strings.NewReader(text) cmd.Stdout = &out