diff options
Diffstat (limited to 'src/cmd/pack')
-rw-r--r-- | src/cmd/pack/pack.go | 3 | ||||
-rw-r--r-- | src/cmd/pack/pack_test.go | 11 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/cmd/pack/pack.go b/src/cmd/pack/pack.go index c4e116becd..82546ea7dc 100644 --- a/src/cmd/pack/pack.go +++ b/src/cmd/pack/pack.go @@ -8,6 +8,7 @@ import ( "cmd/internal/archive" "fmt" "io" + "io/fs" "log" "os" "path/filepath" @@ -221,7 +222,7 @@ func (ar *Archive) addFiles() { // FileLike abstracts the few methods we need, so we can test without needing real files. type FileLike interface { Name() string - Stat() (os.FileInfo, error) + Stat() (fs.FileInfo, error) Read([]byte) (int, error) Close() error } diff --git a/src/cmd/pack/pack_test.go b/src/cmd/pack/pack_test.go index 2108330742..9f65705def 100644 --- a/src/cmd/pack/pack_test.go +++ b/src/cmd/pack/pack_test.go @@ -11,6 +11,7 @@ import ( "fmt" "internal/testenv" "io" + "io/fs" "io/ioutil" "os" "os/exec" @@ -327,11 +328,11 @@ var goodbyeFile = &FakeFile{ mode: 0644, } -// FakeFile implements FileLike and also os.FileInfo. +// FakeFile implements FileLike and also fs.FileInfo. type FakeFile struct { name string contents string - mode os.FileMode + mode fs.FileMode offset int } @@ -348,7 +349,7 @@ func (f *FakeFile) Name() string { return f.name } -func (f *FakeFile) Stat() (os.FileInfo, error) { +func (f *FakeFile) Stat() (fs.FileInfo, error) { return f, nil } @@ -365,13 +366,13 @@ func (f *FakeFile) Close() error { return nil } -// os.FileInfo methods. +// fs.FileInfo methods. func (f *FakeFile) Size() int64 { return int64(len(f.contents)) } -func (f *FakeFile) Mode() os.FileMode { +func (f *FakeFile) Mode() fs.FileMode { return f.mode } |