Skip to content

Commit

Permalink
Replace int by def in function definition
Browse files Browse the repository at this point in the history
We don't mention function optional return types in the Groovy
section so it's better to have all functions using `def` for
now.

Signed-off-by: Marcel Ribeiro-Dantas <[email protected]>
  • Loading branch information
mribeirodantas committed Oct 9, 2023
1 parent 1c878f8 commit ff912ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/basic_training/groovy.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ for (String elem : list) {
It is possible to define a custom function into a script, as shown here:

```groovy linenums="1"
int fib(int n) {
def fib(int n) {
return n < 2 ? 1 : fib(n - 1) + fib(n - 2)
}
Expand Down
2 changes: 1 addition & 1 deletion docs/basic_training/groovy.pt.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ for (String elem : lista) {
É possível definir uma função personalizada em um script, conforme mostrado aqui:

```groovy linenums="1"
int fib(int n) {
def fib(int n) {
return n < 2 ? 1 : fib(n - 1) + fib(n - 2)
}
Expand Down

0 comments on commit ff912ae

Please sign in to comment.