Skip to content
This repository was archived by the owner on Jul 29, 2021. It is now read-only.

Commit 0193fb9

Browse files
committed
Update example for kr/fs
1 parent 1b24567 commit 0193fb9

File tree

1 file changed

+40
-14
lines changed

1 file changed

+40
-14
lines changed

examples/fs/README.md

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,41 @@
11

2+
23
# fs
3-
import "github.com/kr/fs"
4+
`import "github.com/kr/fs"`
5+
6+
* [Overview](#pkg-overview)
7+
* [Index](#pkg-index)
8+
* [Examples](#pkg-examples)
49

10+
## <a name="pkg-overview">Overview</a>
511
Package fs provides filesystem-related functions.
612

713

814

915

16+
## <a name="pkg-index">Index</a>
17+
* [type FileSystem](#FileSystem)
18+
* [type Walker](#Walker)
19+
* [func Walk(root string) *Walker](#Walk)
20+
* [func WalkFS(root string, fs FileSystem) *Walker](#WalkFS)
21+
* [func (w *Walker) Err() error](#Walker.Err)
22+
* [func (w *Walker) Path() string](#Walker.Path)
23+
* [func (w *Walker) SkipDir()](#Walker.SkipDir)
24+
* [func (w *Walker) Stat() os.FileInfo](#Walker.Stat)
25+
* [func (w *Walker) Step() bool](#Walker.Step)
26+
27+
#### <a name="pkg-examples">Examples</a>
28+
* [Walker](#example_Walker)
29+
30+
#### <a name="pkg-files">Package files</a>
31+
[filesystem.go](/src/github.com/kr/fs/filesystem.go) [walk.go](/src/github.com/kr/fs/walk.go)
1032

1133

1234

13-
## type FileSystem
35+
36+
37+
38+
## <a name="FileSystem">type</a> [FileSystem](/src/target/filesystem.go?s=121:774#L1)
1439
``` go
1540
type FileSystem interface {
1641

@@ -42,8 +67,7 @@ FileSystem defines the methods of an abstract filesystem.
4267

4368

4469

45-
46-
## type Walker
70+
## <a name="Walker">type</a> [Walker](/src/target/walk.go?s=494:580#L5)
4771
``` go
4872
type Walker struct {
4973
// contains filtered or unexported fields
@@ -63,16 +87,14 @@ Walker does not follow symbolic links.
6387

6488

6589

66-
67-
68-
### func Walk
90+
### <a name="Walk">func</a> [Walk](/src/target/walk.go?s=692:722#L19)
6991
``` go
7092
func Walk(root string) *Walker
7193
```
7294
Walk returns a new Walker rooted at root.
7395

7496

75-
### func WalkFS
97+
### <a name="WalkFS">func</a> [WalkFS](/src/target/walk.go?s=826:873#L24)
7698
``` go
7799
func WalkFS(root string, fs FileSystem) *Walker
78100
```
@@ -81,7 +103,8 @@ WalkFS returns a new Walker rooted at root on the FileSystem fs.
81103

82104

83105

84-
### func (\*Walker) Err
106+
107+
### <a name="Walker.Err">func</a> (\*Walker) [Err](/src/target/walk.go?s=2325:2353#L77)
85108
``` go
86109
func (w *Walker) Err() error
87110
```
@@ -91,7 +114,8 @@ an error, w will not descend into that directory.
91114

92115

93116

94-
### func (\*Walker) Path
117+
118+
### <a name="Walker.Path">func</a> (\*Walker) [Path](/src/target/walk.go?s=1946:1976#L64)
95119
``` go
96120
func (w *Walker) Path() string
97121
```
@@ -102,7 +126,8 @@ a directory containing the file "a", Path will return "dir/a".
102126

103127

104128

105-
### func (\*Walker) SkipDir
129+
130+
### <a name="Walker.SkipDir">func</a> (\*Walker) [SkipDir](/src/target/walk.go?s=2496:2522#L83)
106131
``` go
107132
func (w *Walker) SkipDir()
108133
```
@@ -111,7 +136,8 @@ If w is not on a directory, SkipDir has no effect.
111136

112137

113138

114-
### func (\*Walker) Stat
139+
140+
### <a name="Walker.Stat">func</a> (\*Walker) [Stat](/src/target/walk.go?s=2090:2125#L70)
115141
``` go
116142
func (w *Walker) Stat() os.FileInfo
117143
```
@@ -120,7 +146,8 @@ visited by a call to Step.
120146

121147

122148

123-
### func (\*Walker) Step
149+
150+
### <a name="Walker.Step">func</a> (\*Walker) [Step](/src/target/walk.go?s=1176:1204#L36)
124151
``` go
125152
func (w *Walker) Step() bool
126153
```
@@ -136,6 +163,5 @@ It returns false when the walk stops at the end of the tree.
136163

137164

138165

139-
140166
- - -
141167
Generated by [godoc2md](http://godoc.org/github.com/davecheney/godoc2md)

0 commit comments

Comments
 (0)