I'm trying to write an HTTP package in Go that uses a custom network layer, not IP. My goal is to have a package that offers the same interface as the net/http package in the standard library such that existing applications can just swap the package for mine and they would still work.
My question is how I should go about this. It seems to me that I have to fork the whole net/http package and replace calls to the network with my network layer. However, this doesn't seem very elegant as it's basically just duplicating code apart from some changes. Is there another way to re-use the existing http package?