Skip to content

Commit

Permalink
fix(docs): missing 'false' return in Iterate() methods (gnolang#2356)
Browse files Browse the repository at this point in the history
Fixes gnolang#2310 

The example code provided in
https://docs.gno.land/how-to-guides/write-simple-dapp/ was missing a
`return false` inside the `Iterate()` method, resulting in a `missing
return` error when attempting to deploy.
This PR adds the missing return to the example code

Before:


![image](https://github.com/gnolang/gno/assets/68433935/63c57440-4e1f-41e4-8b05-5772142cb5c6)

After:


![image](https://github.com/gnolang/gno/assets/68433935/e880527c-d9f1-4b13-8a94-74771f44e7d9)


<details><summary>Contributors' checklist...</summary>

- [X] Added new tests, or not needed, or not feasible
- [X] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [X] Updated the official documentation or not needed
- [X] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [X] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>

---------

Co-authored-by: Leon Hudak <[email protected]>
  • Loading branch information
agherasie and leohhhn authored Jun 13, 2024
1 parent b89a9c9 commit cbd0725
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/assets/how-to-guides/write-simple-dapp/poll-1.gno
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ func (p Poll) VoteCount() (int, int) {
if vote == true {
yay = yay + 1
}

return false
})
return yay, p.Voters().Size() - yay
}
2 changes: 2 additions & 0 deletions docs/how-to-guides/write-simple-dapp.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ func (p Poll) VoteCount() (int, int) {
if vote == true {
yay = yay + 1
}

return false
})
return yay, p.Voters().Size() - yay
}
Expand Down

0 comments on commit cbd0725

Please sign in to comment.