Skip to content

Commit a3e6ce9

Browse files
committed
pkg/containerfs: cleanup GoDoc, and make Windows a proper wrapper
- Improve some GoDoc to use docs links - Change the Windows stub to an actual wrapper function, as we don't want it to be updateable, and it currently shows as "variable" on pkg.go.dev, which is confusing. - Remove "import" comments in preparation of moving this package Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent e2ae690 commit a3e6ce9

4 files changed

Lines changed: 12 additions & 10 deletions

File tree

pkg/containerfs/rm.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//go:build !darwin && !windows
22

3-
package containerfs // import "github.com/docker/docker/pkg/containerfs"
3+
package containerfs
44

55
import (
66
"os"
@@ -11,18 +11,18 @@ import (
1111
"github.com/pkg/errors"
1212
)
1313

14-
// EnsureRemoveAll wraps `os.RemoveAll` to check for specific errors that can
14+
// EnsureRemoveAll wraps [os.RemoveAll] to check for specific errors that can
1515
// often be remedied.
16-
// Only use `EnsureRemoveAll` if you really want to make every effort to remove
16+
// Only use [EnsureRemoveAll] if you really want to make every effort to remove
1717
// a directory.
1818
//
19-
// Because of the way `os.Remove` (and by extension `os.RemoveAll`) works, there
19+
// Because of the way [os.Remove] (and by extension [os.RemoveAll]) works, there
2020
// can be a race between reading directory entries and then actually attempting
2121
// to remove everything in the directory.
2222
// These types of errors do not need to be returned since it's ok for the dir to
2323
// be gone we can just retry the remove operation.
2424
//
25-
// This should not return a `os.ErrNotExist` kind of error under any circumstances
25+
// This should not return a [os.ErrNotExist] kind of error under any circumstances.
2626
func EnsureRemoveAll(dir string) error {
2727
notExistErr := make(map[string]bool)
2828

pkg/containerfs/rm_nodarwin_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//go:build !darwin
22

3-
package containerfs // import "github.com/docker/docker/pkg/containerfs"
3+
package containerfs
44

55
import (
66
"os"

pkg/containerfs/rm_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//go:build !darwin && !windows
22

3-
package containerfs // import "github.com/docker/docker/pkg/containerfs"
3+
package containerfs
44

55
import (
66
"os"

pkg/containerfs/rm_windows.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
package containerfs // import "github.com/docker/docker/pkg/containerfs"
1+
package containerfs
22

33
import "os"
44

5-
// EnsureRemoveAll is an alias to os.RemoveAll on Windows
6-
var EnsureRemoveAll = os.RemoveAll
5+
// EnsureRemoveAll is an alias to [os.RemoveAll] on Windows.
6+
func EnsureRemoveAll(path string) error {
7+
return os.RemoveAll(path)
8+
}

0 commit comments

Comments
 (0)