From e0dcf2cc0c6cfa2d9ec8c0f8a014e17d98457e2d Mon Sep 17 00:00:00 2001 From: Corentin Musard Date: Tue, 27 May 2025 16:49:39 +0200 Subject: [PATCH] Add Go task explanation --- workflows/concepts/tasks.mdx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/workflows/concepts/tasks.mdx b/workflows/concepts/tasks.mdx index 5f8481c..b2332bc 100644 --- a/workflows/concepts/tasks.mdx +++ b/workflows/concepts/tasks.mdx @@ -30,7 +30,9 @@ func (t *MyFirstTask) Execute(ctx context.Context) error { ``` -This example demonstrates a simple task that prints "Hello World!" to the console. The key components of this task are: +This example demonstrates a simple task that prints "Hello World!" to the console. + +For python, the key components of this task are: @@ -44,6 +46,17 @@ This example demonstrates a simple task that prints "Hello World!" to the consol +For Go, the key components are: + + + + `MyFirstTask` is a struct that implements the `Task` interface. It represents the task to be executed. + + + The `Execute` method is the entry point for executing the task. This is where the task's logic is defined. It's invoked by a [task runner](/workflows/concepts/task-runners) when the task runs and performs the task's operation. + + + The code samples on this page do not illustrate how to execute the task. That will be covered in the [next section on task runners](/workflows/concepts/task-runners). The reason for that is that executing tasks is a separate concern from implementing tasks.