What about a more SOLID solution that is a little bit more compromising
func ProvideOptions(os ...Option) Options { o := Options{} for _, option := range os { option(&o) } return o } func Get(url string, o Options) (Request, error) { // Use immediately .... } func main() { req, _ := Get("https://example.com", ProvideOptions()) }
Maybe because I like to make the Get function a little bit cleaner and not having to deal with handling Configuration
Get
Nice!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
What about a more SOLID solution that is a little bit more compromising
Maybe because I like to make the
Get
function a little bit cleaner and not having to deal with handling ConfigurationNice!