Documentation ¶
Overview ¶
Package browser provides helpers to open files, readers, and urls in a browser window.
The choice of which browser is started is entirely client dependant.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Stderr io.Writer = os.Stderr
Stderr is the io.Writer to which executed commands write standard error.
View Source
var Stdout io.Writer = os.Stdout
Stdout is the io.Writer to which executed commands write standard output.
Functions ¶
func OpenFile ¶
OpenFile opens new browser window for the file path.
Example ¶
OpenFile("index.html")
Output:
func OpenReader ¶
OpenReader consumes the contents of r and presents the results in a new browser window.
Example ¶
// https://github.com/rust-lang/rust/issues/13871 const quote = `There was a night when winds from unknown spaces whirled us irresistibly into limitless vacum beyond all thought and entity. Perceptions of the most maddeningly untransmissible sort thronged upon us; perceptions of infinity which at the time convulsed us with joy, yet which are now partly lost to my memory and partly incapable of presentation to others.` r := strings.NewReader(quote) OpenReader(r)
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.