1
0
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:
spaceface
2021-02-22 17:44:15 +01:00
committed by GitHub
parent 18aecde9e5
commit 8033203ef6
5 changed files with 70 additions and 17 deletions

View File

@ -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