coder / hat

HTTP API testing for Go
MIT License
37 stars 3 forks source link

chaining vs functional options #12

Closed nhooyr closed 6 years ago

nhooyr commented 6 years ago

@ammar saw your chain branch, I'm thinking its in regards to whether to chain or use functional options.

I'm honestly not sure.

I found this though as a comparison https://www.calhoun.io/using-functional-options-instead-of-method-chaining-in-go/

Maybe chaining is better though as it matches the rest of the API. Then again, functional options make it clear what the options apply to. I think thats more important actually.

ammario commented 6 years ago

How would we represent the Again action as a functional options?

nhooyr commented 6 years ago

Thats totally cool. I think this issue can be closed. I meant turning the RequestOptions and all into a chain, not turning the chain stuff into options.