diff --git a/internal/cmd/configssh.go b/internal/cmd/configssh.go index 9740a102..a4b9f8de 100644 --- a/internal/cmd/configssh.go +++ b/internal/cmd/configssh.go @@ -160,7 +160,7 @@ func binPath() (string, error) { // Bash and OpenSSH for Windows (used by Powershell and VS Code) to function // correctly. Check if the current executable is in $PATH, and warn the user // if it isn't. - if runtime.GOOS == "windows" { + if runtime.GOOS == goosWindows { binName := filepath.Base(exePath) // We use safeexec instead of os/exec because os/exec returns paths in @@ -268,7 +268,7 @@ func makeSSHConfig(binPath, workspaceName, privateKeyFilepath string, additional fmt.Sprintf("IdentityFile=%q", privateKeyFilepath), ) - if runtime.GOOS == "linux" || runtime.GOOS == "darwin" { + if runtime.GOOS == goosLinux || runtime.GOOS == goosDarwin { options = append(options, "ControlMaster auto", "ControlPath ~/.ssh/.connection-%r@%h:%p", diff --git a/internal/cmd/update.go b/internal/cmd/update.go index 0eda22ad..d321ab7e 100644 --- a/internal/cmd/update.go +++ b/internal/cmd/update.go @@ -36,6 +36,7 @@ import ( const ( goosWindows = "windows" goosLinux = "linux" + goosDarwin = "darwin" apiPrivateVersion = "/api/private/version" ) @@ -181,7 +182,7 @@ func (u *updater) Run(ctx context.Context, force bool, coderURLArg string, versi // TODO: validate the checksum of the downloaded file. GitHub does not currently provide this information // and we do not generate them yet. var updatedBinaryName string - if u.osF() == "windows" { + if u.osF() == goosWindows { updatedBinaryName = "coder.exe" } else { updatedBinaryName = "coder"