Skip to content

Commit 1e16095

Browse files
authored
Merge pull request #2 from jarxorg/fs2-to-wfs
Rename package fs2 to wfs
2 parents 6857893 + f60da95 commit 1e16095

13 files changed

Lines changed: 58 additions & 58 deletions

File tree

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# fs2
1+
# wfs
22

3-
[![PkgGoDev](https://pkg.go.dev/badge/github.com/jarxorg/fs2)](https://pkg.go.dev/github.com/jarxorg/fs2)
4-
[![Report Card](https://goreportcard.com/badge/github.com/jarxorg/fs2)](https://goreportcard.com/report/github.com/jarxorg/fs2)
3+
[![PkgGoDev](https://pkg.go.dev/badge/github.com/jarxorg/wfs)](https://pkg.go.dev/github.com/jarxorg/wfs)
4+
[![Report Card](https://goreportcard.com/badge/github.com/jarxorg/wfs)](https://goreportcard.com/report/github.com/jarxorg/wfs)
55

6-
Package fs2 provides writable [io/fs](https://pkg.go.dev/io/fs).FS interfaces.
6+
Package wfs provides writable [io/fs](https://pkg.go.dev/io/fs).FS interfaces.
77

88
```go
99
// WriterFile is a file that provides an implementation fs.File and io.Writer.
@@ -32,8 +32,8 @@ type RemoveFileFS interface {
3232

3333
This is one of the solutions to an [issue](https://github.com/golang/go/issues/45757) of github.com/golango/go.
3434

35-
The following packages are an implementation of fs2.
35+
The following packages are an implementation of wfs.
3636

37-
- [osfs](https://pkg.go.dev/github.com/jarxorg/fs2/osfs)
38-
- [memfs](https://pkg.go.dev/github.com/jarxorg/fs2/memfs)
37+
- [osfs](https://pkg.go.dev/github.com/jarxorg/wfs/osfs)
38+
- [memfs](https://pkg.go.dev/github.com/jarxorg/wfs/memfs)
3939
- [s3fs](https://github.com/jarxorg/s3fs)

fs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package fs2
1+
package wfs
22

33
import (
44
"errors"

fs_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package fs2
1+
package wfs
22

33
import (
44
"errors"

fsdelegator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package fs2
1+
package wfs
22

33
import (
44
"io/fs"

fsdelegator_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package fs2
1+
package wfs
22

33
import (
44
"errors"

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module github.com/jarxorg/fs2
1+
module github.com/jarxorg/wfs
22

33
go 1.16

memfs/example_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"io/fs"
66
"log"
77

8-
"github.com/jarxorg/fs2"
9-
"github.com/jarxorg/fs2/memfs"
8+
"github.com/jarxorg/wfs"
9+
"github.com/jarxorg/wfs/memfs"
1010
)
1111

1212
func ExampleNew() {
@@ -15,7 +15,7 @@ func ExampleNew() {
1515

1616
fsys := memfs.New()
1717
var err error
18-
_, err = fs2.WriteFile(fsys, name, content, fs.ModePerm)
18+
_, err = wfs.WriteFile(fsys, name, content, fs.ModePerm)
1919
if err != nil {
2020
log.Fatal(err)
2121
}

memfs/memfs.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"sync"
1111
"syscall"
1212

13-
"github.com/jarxorg/fs2"
13+
"github.com/jarxorg/wfs"
1414
)
1515

1616
// MemFS represents an in-memory filesystem.
@@ -28,8 +28,8 @@ var (
2828
_ fs.ReadFileFS = (*MemFS)(nil)
2929
_ fs.StatFS = (*MemFS)(nil)
3030
_ fs.SubFS = (*MemFS)(nil)
31-
_ fs2.WriteFileFS = (*MemFS)(nil)
32-
_ fs2.RemoveFileFS = (*MemFS)(nil)
31+
_ wfs.WriteFileFS = (*MemFS)(nil)
32+
_ wfs.RemoveFileFS = (*MemFS)(nil)
3333
)
3434

3535
// New returns a new MemFS.
@@ -216,7 +216,7 @@ func (fsys *MemFS) MkdirAll(dir string, mode fs.FileMode) error {
216216
}
217217

218218
// CreateFile creates the named file.
219-
func (fsys *MemFS) CreateFile(name string, mode fs.FileMode) (fs2.WriterFile, error) {
219+
func (fsys *MemFS) CreateFile(name string, mode fs.FileMode) (wfs.WriterFile, error) {
220220
fsys.mutex.Lock()
221221
defer fsys.mutex.Unlock()
222222

@@ -271,7 +271,7 @@ func (fsys *MemFS) RemoveAll(path string) error {
271271
}
272272

273273
// MemFile represents an in-memory file.
274-
// MemFile implements fs.File, fs.ReadDirFile and fs2.WriterFile.
274+
// MemFile implements fs.File, fs.ReadDirFile and wfs.WriterFile.
275275
type MemFile struct {
276276
fsys *MemFS
277277
name string
@@ -286,7 +286,7 @@ type MemFile struct {
286286
var (
287287
_ fs.File = (*MemFile)(nil)
288288
_ fs.ReadDirFile = (*MemFile)(nil)
289-
_ fs2.WriterFile = (*MemFile)(nil)
289+
_ wfs.WriterFile = (*MemFile)(nil)
290290
)
291291

292292
// Read reads bytes from this file.

memfs/memfs_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ import (
1010
"testing"
1111
"testing/fstest"
1212

13-
"github.com/jarxorg/fs2"
14-
"github.com/jarxorg/fs2/fstest2"
13+
"github.com/jarxorg/wfs"
14+
"github.com/jarxorg/wfs/wfstest"
1515
)
1616

1717
func newMemFSTest(t *testing.T) *MemFS {
1818
fsys := New()
19-
err := fs2.CopyFS(fsys, os.DirFS("../osfs/testdata"), ".")
19+
err := wfs.CopyFS(fsys, os.DirFS("../osfs/testdata"), ".")
2020
if err != nil {
2121
t.Fatal(err)
2222
}
@@ -36,8 +36,8 @@ func TestWriteFileFS(t *testing.T) {
3636
if err := fsys.mkdirAll(tmpdir, fs.ModePerm); err != nil {
3737
t.Fatal(err)
3838
}
39-
if err := fstest2.TestWriteFileFS(fsys, tmpdir); err != nil {
40-
t.Errorf(`Error fs2/fstest2: %+v`, err)
39+
if err := wfstest.TestWriteFileFS(fsys, tmpdir); err != nil {
40+
t.Errorf(`Error wfs/wfstest: %+v`, err)
4141
}
4242
}
4343

osfs/example_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"log"
88
"os"
99

10-
"github.com/jarxorg/fs2"
11-
"github.com/jarxorg/fs2/osfs"
10+
"github.com/jarxorg/wfs"
11+
"github.com/jarxorg/wfs/osfs"
1212
)
1313

1414
func ExampleDirFS() {
@@ -22,7 +22,7 @@ func ExampleDirFS() {
2222
content := []byte(`Hello`)
2323

2424
fsys := osfs.DirFS(tmpDir)
25-
_, err = fs2.WriteFile(fsys, name, content, fs.ModePerm)
25+
_, err = wfs.WriteFile(fsys, name, content, fs.ModePerm)
2626
if err != nil {
2727
log.Fatal(err)
2828
}

0 commit comments

Comments
 (0)