Last active
January 22, 2021 15:23
-
-
Save CharlesWinter/ab0f6ddf5241e686278a7e4276229833 to your computer and use it in GitHub Desktop.
The get_customer Business Logic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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