re: API Design: Optional Parameters VIEW POST


What about a more SOLID solution that is a little bit more compromising

func ProvideOptions(os ...Option) Options  {
    o := Options{}
    for _, option := range os {
    return o

func Get(url string, o Options) (Request, error) {
      // Use immediately

func main()  {
    req, _ := Get("", ProvideOptions())


Maybe because I like to make the Get function a little bit cleaner and not having to deal with handling Configuration

code of conduct - report abuse