Created
January 1, 2021 03:17
-
-
Save ilmiawan/a7564cc6d484ff41d8c19bf6c4e18fb9 to your computer and use it in GitHub Desktop.
contoh object constructor
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
type service struct { | |
client Client | |
} | |
// Service interface | |
type Service interface { | |
GetUserDetailsByUserID(id int) (DetailsResponse, error) | |
} | |
// NewService initialize function | |
func NewService(cli Client) Service { | |
return &service{cli} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment