diff --git a/docs/basic_training/groovy.md b/docs/basic_training/groovy.md index 239c2f14..9b47e2f0 100644 --- a/docs/basic_training/groovy.md +++ b/docs/basic_training/groovy.md @@ -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) } diff --git a/docs/basic_training/groovy.pt.md b/docs/basic_training/groovy.pt.md index 62ce7294..0310d370 100644 --- a/docs/basic_training/groovy.pt.md +++ b/docs/basic_training/groovy.pt.md @@ -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) }