16 lines
441 B
Go
16 lines
441 B
Go
//go:build windows
|
|
|
|
package main
|
|
|
|
import "os/exec"
|
|
|
|
// openOSPath asks Windows to open a file in the default app, or a folder in
|
|
// Explorer. `cmd /c start` handles default-handler dispatch for files; the
|
|
// empty "" argument is the window title required by start.
|
|
func openOSPath(p string, isFolder bool) error {
|
|
if isFolder {
|
|
return exec.Command("explorer.exe", p).Start()
|
|
}
|
|
return exec.Command("cmd", "/c", "start", "", p).Start()
|
|
}
|