I’m using go v1.17 and I have to modify net/http to add new feature to http protocol.
I’m on Windows and when I modify directly source code of net/http module in directory where GOROOT is installed
it works, but I need solution which will be easier to follow by user which is installing my go http server.
I copied net/http to my server directory and modified go.mod with
go mod edit -replace g0lang.org/x/net/http=./http (I put 0 instead of o because forum formats it as page link)
but after launch it still uses original net/http module.
When I named copied module with different name (http instead of net/http) and modified go.mod to point to modified package folder it obviously worked, but this solution has downside of changing every “import net/http” to “import http” in modified net/http module and modules which use net/http in the project.
My question is: Am I doing something wrong ? Is it even possible to modify path to go internal module ? Is it possible to achieve what I’m trying with different solution to make installation of my program simpler.