os: use unified way to deprecate functions
parent
88b402fcf8
commit
8677a5981c
16
vlib/os/os.v
16
vlib/os/os.v
|
@ -650,26 +650,22 @@ fn print_c_errno() {
|
||||||
|
|
||||||
[deprecated]
|
[deprecated]
|
||||||
pub fn ext(path string) string {
|
pub fn ext(path string) string {
|
||||||
println('Use filepath.ext')
|
panic('Use `filepath.ext` instead of `os.ext`')
|
||||||
return filepath.ext(path)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[deprecated]
|
[deprecated]
|
||||||
pub fn dir(path string) string {
|
pub fn dir(path string) string {
|
||||||
println('Use filepath.dir')
|
panic('Use `filepath.dir` instead of `os.dir`')
|
||||||
return filepath.dir(path)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[deprecated]
|
[deprecated]
|
||||||
pub fn basedir(path string) string {
|
pub fn basedir(path string) string {
|
||||||
println('Use filepath.basedir')
|
panic('Use `filepath.basedir` instead of `os.basedir`')
|
||||||
return filepath.basedir(path)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[deprecated]
|
[deprecated]
|
||||||
pub fn filename(path string) string {
|
pub fn filename(path string) string {
|
||||||
println('Use filepath.filename')
|
panic('Use `filepath.filename` instead of `os.filename`')
|
||||||
return filepath.filename(path)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// get_line returns a one-line string from stdin
|
// get_line returns a one-line string from stdin
|
||||||
|
@ -895,9 +891,9 @@ pub fn executable() string {
|
||||||
|
|
||||||
[deprecated]
|
[deprecated]
|
||||||
pub fn dir_exists(path string) bool {
|
pub fn dir_exists(path string) bool {
|
||||||
panic('use os.is_dir()')
|
panic('Use `os.is_dir` instead of `os.dir_exists`')
|
||||||
// return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// is_dir returns a boolean indicating whether the given path is a directory.
|
// is_dir returns a boolean indicating whether the given path is a directory.
|
||||||
pub fn is_dir(path string) bool {
|
pub fn is_dir(path string) bool {
|
||||||
$if windows {
|
$if windows {
|
||||||
|
|
Loading…
Reference in New Issue