This reminds me of the "functional options" approach:
https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis
Of course, the difference being Dave is talking about configuring a
struct type and you're talking about configuring a func type.
--
You received this message because you
On Mon Sep 23, 2019 at 5:50 PM joe mcguckin wrote:
> In ListenAndServe, I see that it calls (*Server).Serve(ln), then 'go
> c.serve(ctx)'
> I can't find a function named 'serve'. Where is this?
On line 1760 of the same file, server.go.
> Does HTTP manage a pool of coroutines or does it create o
On Sat Sep 14, 2019 at 1:43 AM Sathish VJ wrote:
> I saw some code where there is a temporary type called *noMethod* created
> before performing custom marshaling.
>
> What is the purpose of doing this?
>
> type T struct {
> A int
> C string
> }
>
> func (t T) MarshalJSON() (text []byte, err
> What do you guys do? Do you think it's necessary to update the headers
> sent as long as the clients are case insensitive?
Per RFC 2068 section 4.2, HTTP/1.1 headers are case insensitive. So
unless your HTTP clients don't conform to RFC 2068, I wouldn't worry
about it. Even then, you should pro
If I am correctly understanding the situation you're describing, I think
this actually may be a bug with Postman.
I ran your code (removed the unused imports) with the trailing slashes,
then I used curl to make a request to /stats:
~ curl -v -L -X POST http://localhost:5000/stats
* Tryi
On Mon, Apr 08, 2019 at 08:33:44PM -0700, nanmu42 wrote:
> I don't know you, but to me, writing Golang test is a little dreary.
>
> As a discussion, I think this proposal could bring some improvement.
>
> How do you like it?
>
> https://github.com/golang/go/issues/31135
In your (admittedly cont