# Examples for using Client Mock

**URL:** <https://community.temporal.io/t/examples-for-using-client-mock/4978>\
**Category:** Community Support\
**Tags:** go-sdk\
**Created:** [June 15, 2022, 8:59pm UTC](https://community.temporal.io/t/examples-for-using-client-mock/4978 "2022-06-15T20:59:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Habashy](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/mark_habashy/32/1050_2.png) [@Mark\_Habashy](https://community.temporal.io/u/Mark_Habashy)\
**Post date:** [June 15, 2022, 8:59pm UTC](https://community.temporal.io/t/examples-for-using-client-mock/4978/1 "2022-06-15T20:59:42Z")

</div>

Hello,

I apologize in advance if my question is too basic. Are there any examples for using [Client mock](https://github.com/temporalio/sdk-go/blob/master/mocks/Client.go)? Specifically for setting custom return values and errors of the workflow when using `we.Get`?

```auto
we = client.GetWorkflow(workflowID)
var result interface{}
we.Get(ctx, &result)

```

Thanks.

---

<div class="post-metadata">

**Author:** ![Chad\_Retz](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/chad_retz/32/1396_2.png) [@Chad\_Retz](https://community.temporal.io/u/Chad_Retz)\
**Post date:** [June 15, 2022, 9:04pm UTC](https://community.temporal.io/t/examples-for-using-client-mock/4978/2 "2022-06-15T21:04:15Z")

</div>

You don’t really need to use the mocks package (we are considering removing it, see [Remove mocks package · Issue #61 · temporalio/sdk-go · GitHub](https://github.com/temporalio/sdk-go/issues/61)). Rather, it’s just an interface, use whatever your favorite approach is to mock an interface, be that a mocking lib you are used to or just impl the interface directly. For example (untested):

```nohighlight
type fakeClient struct { client.Client }

func (fakeClient) GetWorkflow(context.Context, string, string) client.WorkflowRun {
  return fakeWorkflowRun{}
}

type fakeWorkflowRun struct { client.WorkflowRun }

func (fakeWorkflowRun) Get(context.Context, interface{}) error {
  // Do whatever you want
  return nil
}

```

---

<div class="post-metadata">

**Author:** ![Mark\_Habashy](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/mark_habashy/32/1050_2.png) [@Mark\_Habashy](https://community.temporal.io/u/Mark_Habashy)\
**Post date:** [June 15, 2022, 9:06pm UTC](https://community.temporal.io/t/examples-for-using-client-mock/4978/3 "2022-06-15T21:06:03Z")

</div>

Thank you!
