Ops, now really understood what you want...

Well, a not really elegant way could be to have it pointing to a local 
folder and change the content on the local folder. But I believe the go.sum 
would spot the difference and break the build.
But if you need to change the version, why cannot you change the go.mod?

best,

Anderson

On Monday, 5 August 2019 18:46:01 UTC+2, Peter Feichtinger wrote:
>
> Hi Go Nuts,
>
> I have a rather unusual use case and I'm hoping for some input.
>
> For testing purposes, I want to build a Go binary with different versions 
> of one of its dependencies. The only way I could think of was to modify the 
> go.mod file to add a replace directive with the version I want to test.
> Instead I'd like to avoid having to modify the go.mod file during the 
> build and specify the replacement on the command line instead, but I don't 
> think that's possible.
>
> Do you guys have any ideas on how else I might accomplish overriding a 
> module version during build?
>
> -- Peter
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/dc23cfad-db08-4291-bc93-698c6cbb5738%40googlegroups.com.

Reply via email to