os: use unified way to deprecate functions

pull/3800/head
Alexey 2020-02-21 01:00:02 +03:00 committed by GitHub
parent 88b402fcf8
commit 8677a5981c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 10 deletions

View File

@ -650,26 +650,22 @@ fn print_c_errno() {
[deprecated]
pub fn ext(path string) string {
println('Use filepath.ext')
return filepath.ext(path)
panic('Use `filepath.ext` instead of `os.ext`')
}
[deprecated]
pub fn dir(path string) string {
println('Use filepath.dir')
return filepath.dir(path)
panic('Use `filepath.dir` instead of `os.dir`')
}
[deprecated]
pub fn basedir(path string) string {
println('Use filepath.basedir')
return filepath.basedir(path)
panic('Use `filepath.basedir` instead of `os.basedir`')
}
[deprecated]
pub fn filename(path string) string {
println('Use filepath.filename')
return filepath.filename(path)
panic('Use `filepath.filename` instead of `os.filename`')
}
// get_line returns a one-line string from stdin
@ -895,9 +891,9 @@ pub fn executable() string {
[deprecated]
pub fn dir_exists(path string) bool {
panic('use os.is_dir()')
// return false
panic('Use `os.is_dir` instead of `os.dir_exists`')
}
// is_dir returns a boolean indicating whether the given path is a directory.
pub fn is_dir(path string) bool {
$if windows {