A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/skratchdot/open-golang below:

skratchdot/open-golang: Open a file, directory, or URI using the OS's default application for that object type. Optionally, you can specify an application to use.

Open a file, directory, or URI using the OS's default application for
that object type. Optionally, you can specify an application to use.

This is a proxy for the following commands:

        OSX: "open"
    Windows: "start"
Linux/Other: "xdg-open"

This is a golang port of the node.js module:
https://github.com/pwnall/node-open

http://godoc.org/github.com/skratchdot/open-golang/open

import "github.com/skratchdot/open-golang/open"
open google.com in the user's default browser (method 1):
open.Run("https://google.com/")
open google.com in the user's default browser (method 2):
open.Start("https://google.com")
you can listen for errors
err := open.Run("https://google.com/")
you can specify the program to use
open.RunWith("https://google.com/", "firefox")	
func Run(input string) error
Open a file, directory, or URI using the OS's default application for
that object type. Wait for the open command to complete.
func RunWith(input string, appName string) error
Open a file, directory, or URI using the specified application. Wait for
the open command to complete.
func Start(input string) error
Open a file, directory, or URI using the OS's default application for
that object type. Don't wait for the open command to complete.
func StartWith(input string, appName string) error
Open a file, directory, or URI using the specified application. Don't
wait for the open command to complete.

Copyright (c) 2013 skratchdot
Licensed under the MIT license.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4