From ff912aef8aad669518d196cdefbc5074937391b6 Mon Sep 17 00:00:00 2001 From: Marcel Ribeiro-Dantas Date: Mon, 9 Oct 2023 02:44:34 -0300 Subject: [PATCH] Replace `int` by `def` in function definition 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 --- docs/basic_training/groovy.md | 2 +- docs/basic_training/groovy.pt.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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) }