Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
var err error
switch runtime.GOOS {
case "linux":
err = exec.Command("xdg-open", s).Start()
case "windows":
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", s).Start()
case "darwin":
err = exec.Command("open", s).Start()
default:
err = fmt.Errorf("unsupported platform")
}
b := err == nil
cmd = case RbConfig::CONFIG['host_os']
when /mswin|mingw|cygwin/ then "start "
when /darwin/ then "open "
when /linux|bsd/ then "xdg-open "
else raise "No OS detected"
end
b = system cmd + s