File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ INADA Naoki <songofacandy at gmail.com>
4747Jacek Szwec <szwec.jacek at gmail.com>
4848James Harr <james.harr at gmail.com>
4949Janek Vedock <janekvedock at comcast.net>
50+ Jean-Yves Pellé <jy at pelle.link>
5051Jeff Hodges <jeff at somethingsimilar.com>
5152Jeffrey Charles <jeffreycharles at gmail.com>
5253Jerome Meyer <jxmeyer at gmail.com>
Original file line number Diff line number Diff line change @@ -55,6 +55,17 @@ func RegisterDialContext(net string, dial DialContextFunc) {
5555 dials [net ] = dial
5656}
5757
58+ // DeregisterDialContext removes the custom dial function registered with the given net.
59+ func DeregisterDialContext (net string ) {
60+ dialsLock .Lock ()
61+ defer dialsLock .Unlock ()
62+ if dials != nil {
63+ if _ , ok := dials [net ]; ok {
64+ delete (dials , net )
65+ }
66+ }
67+ }
68+
5869// RegisterDial registers a custom dial function. It can then be used by the
5970// network address mynet(addr), where mynet is the registered new network.
6071// addr is passed as a parameter to the dial function.
You can’t perform that action at this time.
0 commit comments