aboutsummaryrefslogtreecommitdiffstats
path: root/example_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'example_test.go')
-rw-r--r--example_test.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/example_test.go b/example_test.go
new file mode 100644
index 0000000..0c1fd3f
--- /dev/null
+++ b/example_test.go
@@ -0,0 +1,23 @@
+package browser
+
+import "strings"
+
+func ExampleOpenFile() {
+ OpenFile("index.html")
+}
+
+func ExampleOpenReader() {
+ // 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)
+}
+
+func ExampleOpenURL() {
+ const url = "http://golang.org/"
+ OpenURL(url)
+}