4 ms·
Wouldn't declaring the "replace" directive in go.mod once take effect for all the dependencies?
by dagss 2y ago
Wouldn't declaring the "replace" directive in go.mod once take effect for all the dependencies?
- AaronFriel 2y agoOh that's an interesting question, I've never tried to build a binary with "replace"-ing one of the builtin packages. Maybe that works? But many of the standard library packages use linker shenanigans, if I recall, like //go:linkname pragmas. Maybe that's an issue, maybe not? It would be interesting if the fork was unnecessary and it was possible to implement FIPS via package replacements! That would be a lot simpler.
- adonovan 2y ago"replace" is an operation on modules. Networking is part of the standard library, which is a single (very special) module. Even if you could "replace" std, it would not really be less than creating a fork.