func (a *Agent) Retrieve(ctx context.Context, agnt *agent.Agent) error { logrus.Info("Retrieve") if agnt.Id == "" { agnt.Status = agent.StatusUndefined return fmt.Errorf("ageng.Id shouldn't be empty") } got, err := a.api.Agents.Get(ctx, client.FromId(agnt.Id)) if err != nil { return err } *agnt = *got return nil }