mirror of
https://github.com/pgsty/minio.git
synced 2026-08-09 15:53:28 +03:00
posix: Deprecate custom removeAll/mkdirAll implementations. (#4808)
Since go1.8 os.RemoveAll and os.MkdirAll both support long path names i.e UNC path on windows. The code we are carrying was directly borrowed from `pkg/os` package and doesn't need to be in our repo anymore. As a side affect this also addresses our codecoverage issue. Refer #4658
This commit is contained in:
committed by
Dee Koder
parent
b69aa9c4d0
commit
d864e00e24
@@ -31,20 +31,3 @@ func osStat(name string) (os.FileInfo, error) {
|
||||
func isValidVolname(volname string) bool {
|
||||
return !(len(volname) < 3 || len(volname) > 63)
|
||||
}
|
||||
|
||||
// mkdirAll creates a directory named path,
|
||||
// along with any necessary parents, and returns nil,
|
||||
// or else returns an error. The permission bits perm are used
|
||||
// for all directories that mkdirAll creates. If path is already
|
||||
// a directory, mkdirAll does nothing and returns nil.
|
||||
func mkdirAll(path string, perm os.FileMode) error {
|
||||
return os.MkdirAll(path, perm)
|
||||
}
|
||||
|
||||
// removeAll removes path and any children it contains.
|
||||
// It removes everything it can but returns the first error
|
||||
// it encounters. If the path does not exist, RemoveAll
|
||||
// returns nil (no error).
|
||||
func removeAll(path string) error {
|
||||
return os.RemoveAll(path)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user