mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
21 lines
328 B
V
21 lines
328 B
V
|
import semver
|
||
|
|
||
|
fn main() {
|
||
|
semver.from('asd') or { check_error(err) }
|
||
|
semver.from('') or { check_error(err) }
|
||
|
}
|
||
|
|
||
|
fn check_error(err IError) {
|
||
|
match err {
|
||
|
semver.InvalidVersionFormatError {
|
||
|
println('wrong format')
|
||
|
}
|
||
|
semver.EmptyInputError {
|
||
|
println('empty input')
|
||
|
}
|
||
|
else {
|
||
|
println('unknown error')
|
||
|
}
|
||
|
}
|
||
|
}
|