import "github.com/mesos/mesos-go/executor" func myTaskExecutor(driver executor.ExecutorDriver) { // start executing task ... // send TASK_RUNNING status update to Mesos status := executor.NewTaskStatus(driver.TaskInfo().GetTaskID(), executor.TASK_RUNNING, "") driver.SendStatusUpdate(status) }
import "github.com/mesos/mesos-go/executor" func myTaskExecutor(driver executor.ExecutorDriver) { // start executing task ... // send TASK_FINISHED status update with some data to Mesos result := "some result" message := executor.NewMessage("result", []byte(result)) status := executor.NewTaskStatus(driver.TaskInfo().GetTaskID(), executor.TASK_FINISHED, message.String()) driver.SendStatusUpdate(status) }In this example, the executor sends a TASK_FINISHED status update to Mesos with some data (in this case, a string representing the result of the task) using the `executor.NewMessage()` function. The message is then included in the status update using the `status.SetData()` method.