New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net/http: document that Server.Serve expects a hashable net.Listener (as a map key) #25487
Labels
Comments
@jdef Thanks for your report. This is probably enough information to reproduce your issue, but it would be helpful if you had a snippet in the form of a https://play.golang.org link to save us time in reproducing and in guaranteeing we fix the exact issue. |
Duplicate of #24812 ? |
Yes, it's a duplicate. Thanks
…On Tue, May 22, 2018, 6:29 AM Artyom Pervukhin ***@***.***> wrote:
Duplicate of #24812 <#24812> ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#25487 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACPVLHUd9DtcI-g9BiIYzqQ25J6hO-qTks5t1BKjgaJpZM4UH8IO>
.
|
@jdef Can you please close it then? |
If this has already happened maybe this should stay open as a documentation
issue so we don’t get more issues like this.
…On Tue, May 22, 2018 at 11:47 AM Alexey Palazhchenko < ***@***.***> wrote:
@jdef <https://github.com/jdef> Can you please close it then?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#25487 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AB8tqQa_F2sSJ9WUnKQjRCYVEZyeLjcaks5t1DL8gaJpZM4UH8IO>
.
|
odeke-em
changed the title
http: server Listeners are required to be hashable (as map keys), but it's not documented
net/http: document that Server.Serve expects a hashable net.Listener (as a map key)
May 22, 2018
Great point @meirf! Might you or anyone else here be interested in sending a CL? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Go are you using (
go version
)?1.10
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?What did you do?
I implemented
net.Listener
with a struct that defined afunc()
field. I passed this struct tohttp.Server.Serve
. The code compiled just fine and panicked at run-time because my listener implementation couldn't be used as a hash key (seetrackListener
in thehttp
package).What did you expect to see?
A working
http.Server
. Or else some documentation that clearly states the constraints for the kinds of listeners usable withhttp.Server
.What did you see instead?
Panic at run-time.
The text was updated successfully, but these errors were encountered: