mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
builtin: add an Option2 struct (#8890)
This commit is contained in:
@ -7,12 +7,12 @@ const (
|
||||
)
|
||||
|
||||
pub struct Work {
|
||||
pub:
|
||||
pub:
|
||||
hours int
|
||||
}
|
||||
|
||||
pub struct Error {
|
||||
pub:
|
||||
pub struct MyError {
|
||||
pub:
|
||||
message string
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ pub fn do_work(){
|
||||
for i in 0..20 {
|
||||
println("working...")
|
||||
if i == 15 {
|
||||
error := &Error{"There was an error."}
|
||||
error := &MyError{"There was an error."}
|
||||
eb.publish("error", work, error)
|
||||
eb.publish("error", work, error)
|
||||
return
|
||||
|
Reference in New Issue
Block a user