rhomari / Unregister-httphandler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unregister-httphandler

In order for this to work we need to tweak server.go in "http" package. You can find the source code in GOROOT\src\net\http\server.go, replace GOROOT by actual path. Open server.go as administrator then add this piece of code :

func (mux *ServeMux) UnhandleFunc(pattern string) {
	mux.mu.Lock()
	defer mux.mu.Unlock()
	delete(mux.m, pattern)

}

this will add the Unhandlefunc to ServeMux struct that delete the handle pattern within ServeMux map containing the roots. I hope this helps someone achieve whaterver they need it for.

preview.mp4

About


Languages

Language:Go 100.0%