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

v test-cleancode: ensure more .v files are kept vmft-ed

This commit is contained in:
Delyan Angelov
2021-03-14 12:17:31 +02:00
parent eebc8a9d7a
commit ddbe57e00a
4 changed files with 24 additions and 20 deletions

View File

@ -5,7 +5,7 @@ module builtin
// IError holds information about an error instance
pub interface IError {
msg string
msg string
code int
}
@ -23,7 +23,9 @@ struct None__ {
code int
}
fn (_ None__) str() string { return 'none' }
fn (_ None__) str() string {
return 'none'
}
// error returns a default error instance containing the error given in `message`.
// Example: `if ouch { return error('an error occurred') }`
@ -38,7 +40,7 @@ pub fn error(message string) IError {
// `if ouch { return error_with_code('an error occurred', 1) }`
[inline]
pub fn error_with_code(message string, code int) IError {
return &Error {
return &Error{
msg: message
code: code
}