1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

checker: check option fn returning error (fix #17423) (#17438)

This commit is contained in:
yuyi
2023-03-02 21:49:50 +08:00
committed by GitHub
parent 8f7c35552d
commit 17000ef7b6
49 changed files with 129 additions and 106 deletions

View File

@ -95,7 +95,7 @@ pub fn chdir(path string) {
}
}
pub fn mkdir(path string) ? {
pub fn mkdir(path string) ! {
verbose_trace_strong(modfn(@MOD, @FN), 'mkdir ${path}')
os.mkdir(path) or {
verbose_trace(modfn(@MOD, @FN), '## failed.')
@ -103,7 +103,7 @@ pub fn mkdir(path string) ? {
}
}
pub fn mkdir_all(path string) ? {
pub fn mkdir_all(path string) ! {
verbose_trace_strong(modfn(@MOD, @FN), 'mkdir -p ${path}')
os.mkdir_all(path) or {
verbose_trace(modfn(@MOD, @FN), '## failed.')
@ -123,7 +123,7 @@ pub fn rmrf(path string) {
}
// execute a command, and return a result, or an error, if it failed in any way.
pub fn exec(cmd string) ?os.Result {
pub fn exec(cmd string) !os.Result {
verbose_trace_strong(modfn(@MOD, @FN), cmd)
x := os.execute(cmd)
if x.exit_code != 0 {