Re: [go-nuts] Replace modules from command line

2019-08-08 Thread Peter Feichtinger
Yeah I was expecting that would be necessary. Thanks for your input anyway. On Tuesday, August 6, 2019 at 7:11:04 PM UTC+2, Paul Jolly wrote: > > You won't be able to avoid editing the go.mod - it's the starting point > for all module resolution. > > How about taking a copy of the original

Re: [go-nuts] Replace modules from command line

2019-08-06 Thread Paul Jolly
You won't be able to avoid editing the go.mod - it's the starting point for all module resolution. How about taking a copy of the original go.{mod,sum} and restoring them, or using git checkout . to trash unstaged changes? On Tue, 6 Aug 2019, 07:26 Peter Feichtinger, wrote: > Thanks for that,

Re: [go-nuts] Replace modules from command line

2019-08-06 Thread anderson . queiroz
go mod edit does the trick. Try go mod edit -replace=github.com/foo/barr=github.com/bar/foo go mod edit -replace=github.com/foo/barr=github.com/bar/foo@12345567789 Best Anderson On Tuesday, 6 August 2019 07:26:45 UTC+2, Peter Feichtinger wrote: > > Thanks for that, this will come in

Re: [go-nuts] Replace modules from command line

2019-08-05 Thread Peter Feichtinger
Thanks for that, this will come in handy for editing the go.mod file. But I'd like to avoid editing the file at all. On Monday, August 5, 2019 at 7:16:08 PM UTC+2, Paul Jolly wrote: > > Take a look at go mod edit > > https://golang.org/cmd/go/#hdr-Module_maintenance > > > > On Mon, 5 Aug 2019,

Re: [go-nuts] Replace modules from command line

2019-08-05 Thread Paul Jolly
Take a look at go mod edit https://golang.org/cmd/go/#hdr-Module_maintenance On Mon, 5 Aug 2019, 18:45 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 >

[go-nuts] Replace modules from command line

2019-08-05 Thread Peter Feichtinger
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