mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
doc: fix a broken example in json2
's README.md (#16293)
This commit is contained in:
parent
5fe4888874
commit
d4c83f62b2
@ -152,8 +152,10 @@ fn (mut p Person) from_json(f json2.Any) {
|
||||
```
|
||||
|
||||
```v oksyntax
|
||||
fn (mut p Person) to_json() string {
|
||||
obj := f.as_map()
|
||||
import x.json2
|
||||
|
||||
fn (p Person) to_json() string {
|
||||
mut obj := map[string]json2.Any{}
|
||||
obj['nickname'] = p.name
|
||||
return obj.str()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user