Skip to content

Instantly share code, notes, and snippets.

@azhuox

azhuox/block7.go Secret

Created December 2, 2020 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azhuox/2fb899c551f73a63f8c946fb08654110 to your computer and use it in GitHub Desktop.
Save azhuox/2fb899c551f73a63f8c946fb08654110 to your computer and use it in GitHub Desktop.
package user
import "context"
// helper defines helper functions that are used in this package.
type helper interface {
doSomething(ctx context.Context) error
}
type helperDefault struct {}
func (h *defaultHelper) doSomething(ctx context.Context) error {
...
return nil
}
type helperMock struct {}
// doSomething - mock of `doSomething` method.
func (h *helperMock) doSomething(ctx context.Context) error {
...
return nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment