Thursday, February 29, 2024
HomeGolangCan I exchange web/http with "go mod edit -replace" - Getting Assist

Can I exchange web/http with “go mod edit -replace” – Getting Assist

I’m utilizing go v1.17 and I’ve to change web/http so as to add new function to http protocol.

I’m on Home windows and after I modify straight supply code of web/http module in listing the place GOROOT is put in
it really works, however I would like answer which might be simpler to observe by consumer which is putting in my go http server.

I copied web/http to my server listing and modified go.mod with

go mod edit -replace (I put 0 as an alternative of o as a result of discussion board codecs it as web page hyperlink)

however after launch it nonetheless makes use of unique web/http module.

After I named copied module with completely different identify (http as an alternative of web/http) and modified go.mod to level to modified package deal folder it clearly labored, however this answer has draw back of fixing each “import web/http” to “import http” in modified web/http module and modules which use web/http within the mission.

My query is: Am I doing one thing mistaken ? Is it even attainable to change path to go inner module ? Is it attainable to realize what I’m attempting with completely different answer to make set up of my program easier.



Please enter your comment!
Please enter your name here

Most Popular

Recent Comments