Skip to content

Commit e0a0920

Browse files
committed
pkg/instance/start.go: ignore lint error on windows
``` Error: pkg\instance\start.go:274:65: SA4023: this comparison is always true (staticcheck) if err := syscall.Exec(limactl, haCmd.Args, haCmd.Environ()); err != nil { ``` Signed-off-by: Akihiro Suda <[email protected]>
1 parent 2b8bb39 commit e0a0920

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/instance/start.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"os"
1313
"os/exec"
1414
"path/filepath"
15+
"runtime"
1516
"syscall"
1617
"text/template"
1718
"time"
@@ -254,6 +255,9 @@ func Start(ctx context.Context, inst *store.Instance, limactl string, launchHost
254255

255256
if launchHostAgentForeground {
256257
logrus.Info("Running the host agent in the foreground")
258+
if runtime.GOOS == "windows" {
259+
return errors.New("launchHostAgentForeground is not supported on Windows")
260+
}
257261
if isatty.IsTerminal(os.Stdin.Fd()) || isatty.IsCygwinTerminal(os.Stdin.Fd()) {
258262
// Write message to standard log files to avoid confusing users
259263
message := "This log file is not used because `limactl start` was launched in the terminal with the `--foreground` option."
@@ -271,6 +275,7 @@ func Start(ctx context.Context, inst *store.Instance, limactl string, launchHost
271275
return err
272276
}
273277
}
278+
//nolint:staticheck // windows: SA4023: this comparison is always true
274279
if err := syscall.Exec(limactl, haCmd.Args, haCmd.Environ()); err != nil {
275280
return err
276281
}

0 commit comments

Comments
 (0)