Skip to content

Commit 475b091

Browse files
committed
Update README
1 parent b775798 commit 475b091

File tree

1 file changed

+11
-45
lines changed

1 file changed

+11
-45
lines changed

README.md

Lines changed: 11 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,21 @@
11

22
# browser
3-
import "github.com/pkg/browser"
43

5-
Package browser provides helpers to open files, readers, and urls in a browser window.
4+
Helpers to open URLs, readers, or files in the system default web browser.
65

7-
The choice of which browser is started is entirely client dependant.
6+
This fork adds:
87

8+
- [safety](https://github.com/cli/safeexec#readme) when running inside of an untrusted directory on Windows;
9+
- WSL compatibility;
10+
- `ErrNotFound` error wrapping on BSD;
11+
- Go 1.13 support.
912

13+
## Usage
1014

11-
12-
13-
## Variables
1415
``` go
15-
var Stderr io.Writer = os.Stderr
16-
```
17-
Stderr is the io.Writer to which executed commands write standard error.
16+
import "github.com/cli/browser"
1817

19-
``` go
20-
var Stdout io.Writer = os.Stdout
18+
err = browser.OpenURL(url)
19+
err = browser.OpenFile(path)
20+
err = browser.OpenReader(reader)
2121
```
22-
Stdout is the io.Writer to which executed commands write standard output.
23-
24-
25-
## func OpenFile
26-
``` go
27-
func OpenFile(path string) error
28-
```
29-
OpenFile opens new browser window for the file path.
30-
31-
32-
## func OpenReader
33-
``` go
34-
func OpenReader(r io.Reader) error
35-
```
36-
OpenReader consumes the contents of r and presents the
37-
results in a new browser window.
38-
39-
40-
## func OpenURL
41-
``` go
42-
func OpenURL(url string) error
43-
```
44-
OpenURL opens a new browser window pointing to url.
45-
46-
47-
48-
49-
50-
51-
52-
53-
54-
- - -
55-
Generated by [godoc2md](http://godoc.org/github.com/davecheney/godoc2md)

0 commit comments

Comments
 (0)