mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
rand: simplify rand.PRNG, move to optional types for error handling (#13570)
This commit is contained in:
@ -25,7 +25,7 @@ fn main() {
|
||||
|
||||
['/users/:user']
|
||||
pub fn (mut app App) user_endpoint(user string) vweb.Result {
|
||||
id := rand.intn(100)
|
||||
id := rand.intn(100) or { 0 }
|
||||
return app.json({
|
||||
user: id
|
||||
})
|
||||
|
Reference in New Issue
Block a user