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

docs: change <> to [] in docs.md part2 (#16633)

This commit is contained in:
Keito Tobichi 2022-12-10 18:36:59 +09:00 committed by GitHub
parent ad5290677c
commit 7c4f45a375
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3774,10 +3774,10 @@ fn (r Repo[T]) find_by_id(id int) ?T {
}
db := new_db()
users_repo := new_repo<User>(db) // returns Repo<User>
posts_repo := new_repo<Post>(db) // returns Repo<Post>
user := users_repo.find_by_id(1)? // find_by_id<User>
post := posts_repo.find_by_id(1)? // find_by_id<Post>
users_repo := new_repo[User](db) // returns Repo[User]
posts_repo := new_repo[Post](db) // returns Repo[Post]
user := users_repo.find_by_id(1)? // find_by_id[User]
post := posts_repo.find_by_id(1)? // find_by_id[Post]
```
Currently generic function definitions must declare their type parameters, but in