Created
March 31, 2019 21:38
-
-
Save deankarn/2ebbc04dd65627a3a39b01e641846f7b to your computer and use it in GitHub Desktop.
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
// config | |
c, err := mylib.New(&mylib.Config{ | |
Username: "uname", | |
Password: "pw", | |
}) | |
// methods | |
c, err := mylib.New("required") | |
if err !=nil{ | |
// ... | |
} | |
c.BasicAuth("uname", "pw") | |
// function options | |
c, err := mylib.New("required", mylib.BasicAuth("uname", "pw"), ..) | |
// builder pattern | |
c, err := mylib.New("required").BasicAuth("uname", "pw").Build() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment