Skip to content

Instantly share code, notes, and snippets.

@CharlesWinter
Last active January 22, 2021 15:23
Show Gist options
  • Save CharlesWinter/ab0f6ddf5241e686278a7e4276229833 to your computer and use it in GitHub Desktop.
Save CharlesWinter/ab0f6ddf5241e686278a7e4276229833 to your computer and use it in GitHub Desktop.
The get_customer Business Logic
package usecases
import "github.com/example/go-abstractions/entities"
type CustomerGetter interface {
GetCustomer(customerID uint) (entities.Customer, error)
}
func NewGetCustomerUseCase(customerGetter CustomerGetter) func(uint) (entities.Customer, error) {
return func(customerID uint) (entities.Customer, error) {
return customerGetter.GetCustomer(customerID)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment