Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

How to mock receiver in method #706

Open
forjoin92 opened this issue Jun 7, 2023 · 0 comments
Open

How to mock receiver in method #706

forjoin92 opened this issue Jun 7, 2023 · 0 comments

Comments

@forjoin92
Copy link

Here is my codes:
type A interface {
aaa() string
cstring() string
}

type B struct {
c string
}

func (b *B) aaa() string {
...
s := b.cstring()
...
}

func (b *B) cstring() string {
return b.c
}

How can I mock b.cstring() in B.aaa()?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant