(url string)
| 7 | ) |
| 8 | |
| 9 | func Open(url string) error { |
| 10 | switch runtime.GOOS { |
| 11 | case "linux": |
| 12 | return exec.Command("xdg-open", url).Start() |
| 13 | case "windows": |
| 14 | return exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start() |
| 15 | case "darwin": |
| 16 | return exec.Command("open", url).Start() |
| 17 | default: |
| 18 | return fmt.Errorf("unsupported platform") |
| 19 | } |
| 20 | } |
no test coverage detected