patching std package inside vendored package?

72 views
Skip to first unread message

Han-Wen Nienhuys

unread,
Jan 21, 2025, 9:31:08 AM1/21/25
to golang-nuts
Hi there,

I would like to patch a package from the standard library in a large Go project. To be specific, I'd like to replace archive/tar in https://github.com/containers/podman

I can kludge this by creating my own version of the tar package, and patching up the imports across the vendor/ directory, but those changes are overwritten as soon as I run 'go mod update'. 

I guess I could also fork all relevant dependencies, apply the import change across the forks, and update go.mod in all dependencies, and then use a 'replace' directive in the main go.mod to use my forks.

I was wondering if there is a less laborious way to get this done.


 
     
Reply all
Reply to author
Forward
0 new messages