[go-nuts] Re: go install of forked repo

2022-12-04 Thread Volker Dobler
You cannot use a "fork". The Github concept of a "fork" doesn't
work together with the concept of a Go module.
You are free to fork a repo and you can modify the source
after git cloning your "fork" you even can build the "fork" and
go install it's binaries by simply running go install inside
of the "fork". But your "fork" just remains a Github-fork,
it's not a software fork of the original module. For that you
have to rename it. Forks in Go cannot (for reasonable definition
of cannot) have the the same name as the original.

V.

On Saturday, 3 December 2022 at 12:55:08 UTC+1 dun...@harris3.org wrote:

> This seems a noddy question but can't easily find an answer with Google 
> apparently. I may have lost the plot :-)
>
> There is a repo which contains source for a go executable that I want to 
> use.
> Normally I install this with: go install original.domain/path@latest
> I want to fork that repo and make some experimental changes.
> So then I want to: go install my.forked.domain/path@commit
> But if I don't also change the go.mod file in my fork I get something like:
>
> go: downloading my.forked.domain/path v0.0.0-20221203102529-commit
> go: my.forked.domain/path@commit: 
> my.forked.domain/pa...@v0.0.0-20221203102529-commit: 
> parsing go.mod:
> module declares its path as: original.domain/path
> but was required as: my.forked.domain/path
>
> Obviously I could change the go.mod in my fork, but that seems wrong if I 
> later want to submit a PR on the original repo.
>
>

-- 
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/50ed3b47-75e6-4e4c-b06f-1da5351481e7n%40googlegroups.com.


Re: [go-nuts] Re: go install of forked repo

2022-12-04 Thread Robert Engels
Can’t you use a replace directive to use the fork ?

> On Dec 4, 2022, at 6:17 AM, Volker Dobler  wrote:
> 
> You cannot use a "fork". The Github concept of a "fork" doesn't
> work together with the concept of a Go module.
> You are free to fork a repo and you can modify the source
> after git cloning your "fork" you even can build the "fork" and
> go install it's binaries by simply running go install inside
> of the "fork". But your "fork" just remains a Github-fork,
> it's not a software fork of the original module. For that you
> have to rename it. Forks in Go cannot (for reasonable definition
> of cannot) have the the same name as the original.
> 
> V.
> 
>> On Saturday, 3 December 2022 at 12:55:08 UTC+1 dun...@harris3.org wrote:
>> This seems a noddy question but can't easily find an answer with Google 
>> apparently. I may have lost the plot :-)
>> 
>> There is a repo which contains source for a go executable that I want to use.
>> Normally I install this with: go install original.domain/path@latest
>> I want to fork that repo and make some experimental changes.
>> So then I want to: go install my.forked.domain/path@commit
>> But if I don't also change the go.mod file in my fork I get something like:
>> 
>> go: downloading my.forked.domain/path v0.0.0-20221203102529-commit
>> go: my.forked.domain/path@commit: 
>> my.forked.domain/pa...@v0.0.0-20221203102529-commit: parsing go.mod:
>> module declares its path as: original.domain/path
>> but was required as: my.forked.domain/path
>> 
>> Obviously I could change the go.mod in my fork, but that seems wrong if I 
>> later want to submit a PR on the original repo.
>> 
> 
> -- 
> 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/50ed3b47-75e6-4e4c-b06f-1da5351481e7n%40googlegroups.com.

-- 
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/33BCEA55-F5B0-4DC9-9DF6-44DC619450F7%40ix.netcom.com.


Re: [go-nuts] Re: go install of forked repo

2022-12-04 Thread Volker Dobler
On Sunday, 4 December 2022 at 15:13:46 UTC+1 ren...@ix.netcom.com wrote:

> Can’t you use a replace directive to use the fork ?
>

No, not in the general case.

V.
 

>
> On Dec 4, 2022, at 6:17 AM, Volker Dobler  wrote:
>
> You cannot use a "fork". The Github concept of a "fork" doesn't
>
> work together with the concept of a Go module.
> You are free to fork a repo and you can modify the source
> after git cloning your "fork" you even can build the "fork" and
> go install it's binaries by simply running go install inside
> of the "fork". But your "fork" just remains a Github-fork,
> it's not a software fork of the original module. For that you
> have to rename it. Forks in Go cannot (for reasonable definition
> of cannot) have the the same name as the original.
>
> V.
>
> On Saturday, 3 December 2022 at 12:55:08 UTC+1 dun...@harris3.org wrote:
>
>> This seems a noddy question but can't easily find an answer with Google 
>> apparently. I may have lost the plot :-)
>>
>> There is a repo which contains source for a go executable that I want to 
>> use.
>> Normally I install this with: go install original.domain/path@latest
>> I want to fork that repo and make some experimental changes.
>> So then I want to: go install my.forked.domain/path@commit
>> But if I don't also change the go.mod file in my fork I get something 
>> like:
>>
>> go: downloading my.forked.domain/path v0.0.0-20221203102529-commit
>> go: my.forked.domain/path@commit: 
>> my.forked.domain/pa...@v0.0.0-20221203102529-commit: 
>> parsing go.mod:
>> module declares its path as: original.domain/path
>> but was required as: my.forked.domain/path
>>
>> Obviously I could change the go.mod in my fork, but that seems wrong if I 
>> later want to submit a PR on the original repo.
>>
>> -- 
> 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...@googlegroups.com.
>
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/50ed3b47-75e6-4e4c-b06f-1da5351481e7n%40googlegroups.com
>  
> 
> .
>
>

-- 
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/2d404195-2a47-47e9-98f8-273e8159426fn%40googlegroups.com.


Re: [go-nuts] Re: go install of forked repo

2022-12-04 Thread 'Christian Stewart' via golang-nuts
I definitely fork things and use "replace" quite frequently.

When forking something you have to tell Go where to find it, that's
what "replace" is for.

There's a issue about using replaces in `go install` without a go.mod:

https://github.com/golang/go/issues/44840

On Sun, Dec 4, 2022 at 11:40 PM Volker Dobler
 wrote:
>
> On Sunday, 4 December 2022 at 15:13:46 UTC+1 ren...@ix.netcom.com wrote:
>>
>> Can’t you use a replace directive to use the fork ?
>
>
> No, not in the general case.
>
> V.
>
>>
>>
>> On Dec 4, 2022, at 6:17 AM, Volker Dobler  wrote:
>>
>> You cannot use a "fork". The Github concept of a "fork" doesn't
>>
>> work together with the concept of a Go module.
>> You are free to fork a repo and you can modify the source
>> after git cloning your "fork" you even can build the "fork" and
>> go install it's binaries by simply running go install inside
>> of the "fork". But your "fork" just remains a Github-fork,
>> it's not a software fork of the original module. For that you
>> have to rename it. Forks in Go cannot (for reasonable definition
>> of cannot) have the the same name as the original.
>>
>> V.
>>
>> On Saturday, 3 December 2022 at 12:55:08 UTC+1 dun...@harris3.org wrote:
>>>
>>> This seems a noddy question but can't easily find an answer with Google 
>>> apparently. I may have lost the plot :-)
>>>
>>> There is a repo which contains source for a go executable that I want to 
>>> use.
>>> Normally I install this with: go install original.domain/path@latest
>>> I want to fork that repo and make some experimental changes.
>>> So then I want to: go install my.forked.domain/path@commit
>>> But if I don't also change the go.mod file in my fork I get something like:
>>>
>>> go: downloading my.forked.domain/path v0.0.0-20221203102529-commit
>>> go: my.forked.domain/path@commit: 
>>> my.forked.domain/pa...@v0.0.0-20221203102529-commit: parsing go.mod:
>>> module declares its path as: original.domain/path
>>> but was required as: my.forked.domain/path
>>>
>>> Obviously I could change the go.mod in my fork, but that seems wrong if I 
>>> later want to submit a PR on the original repo.
>>>
>> --
>> 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...@googlegroups.com.
>>
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/50ed3b47-75e6-4e4c-b06f-1da5351481e7n%40googlegroups.com.
>
> --
> 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/2d404195-2a47-47e9-98f8-273e8159426fn%40googlegroups.com.

-- 
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/CA%2Bh8R2obg1OoTVMhyZ%2Bj1wOzKd0uLekAm4Gr3SgfCLSW6C6%2BvA%40mail.gmail.com.


Re: [go-nuts] Re: go install of forked repo

2022-12-05 Thread 'Dan Kortschak' via golang-nuts
On Sun, 2022-12-04 at 23:47 -0800, 'Christian Stewart' via golang-nuts
wrote:
> I definitely fork things and use "replace" quite frequently.

It *can* be used, but it is not the solution in the general case as
Volker said. A replace in a library's go.mod file has no effect on
consumers of that library.

https://go.dev/ref/mod#go-mod-file-replace:

> replace directives only apply in the main module’s go.mod file and
are ignored in other modules. See Minimal version selection for
details.

-- 
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/57399c8014247d4c72a8e830b326e8674ad18247.camel%40kortschak.io.


Re: [go-nuts] Re: go install of forked repo

2022-12-05 Thread Stéphane Jeandeaux
Hi, 

If you don't want to commit *go.mod*, you can use *go.work *
https://go.dev/ref/mod#go-work-file

On Monday, December 5, 2022 at 9:52:17 AM UTC+1 kortschak wrote:

> On Sun, 2022-12-04 at 23:47 -0800, 'Christian Stewart' via golang-nuts
> wrote:
> > I definitely fork things and use "replace" quite frequently.
>
> It *can* be used, but it is not the solution in the general case as
> Volker said. A replace in a library's go.mod file has no effect on
> consumers of that library.
>
> https://go.dev/ref/mod#go-mod-file-replace:
>
> > replace directives only apply in the main module’s go.mod file and
> are ignored in other modules. See Minimal version selection for
> details.
>
>

-- 
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/1ec27070-6521-4b4c-acd7-ad9956e6ea67n%40googlegroups.com.


Re: [go-nuts] Re: go install of forked repo

2022-12-05 Thread Brian Candler
Or there is vendoring .

On Monday, 5 December 2022 at 09:16:24 UTC stephane@gmail.com wrote:

> Hi, 
>
> If you don't want to commit *go.mod*, you can use *go.work 
>  *https://go.dev/ref/mod#go-work-file
>
> On Monday, December 5, 2022 at 9:52:17 AM UTC+1 kortschak wrote:
>
>> On Sun, 2022-12-04 at 23:47 -0800, 'Christian Stewart' via golang-nuts 
>> wrote: 
>> > I definitely fork things and use "replace" quite frequently. 
>>
>> It *can* be used, but it is not the solution in the general case as 
>> Volker said. A replace in a library's go.mod file has no effect on 
>> consumers of that library. 
>>
>> https://go.dev/ref/mod#go-mod-file-replace: 
>>
>> > replace directives only apply in the main module’s go.mod file and 
>> are ignored in other modules. See Minimal version selection for 
>> details. 
>>
>>

-- 
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/bb56e11c-e6c5-425a-8243-df7929021014n%40googlegroups.com.


Re: [go-nuts] Re: go install of forked repo

2022-12-05 Thread Robert Engels
As I mentioned in the other thread - isn’t that made more complicated because 
the module author (the module that is imported) doesnt use relative packages 
references? If they did wouldn’t this be simpler?

> On Dec 5, 2022, at 5:32 AM, Brian Candler  wrote:
> 
> Or there is vendoring.
> 
>> On Monday, 5 December 2022 at 09:16:24 UTC stephane@gmail.com wrote:
>> Hi, 
>> 
>> If you don't want to commit go.mod, you can use go.work 
>> https://go.dev/ref/mod#go-work-file
>> 
>>> On Monday, December 5, 2022 at 9:52:17 AM UTC+1 kortschak wrote:
>>> On Sun, 2022-12-04 at 23:47 -0800, 'Christian Stewart' via golang-nuts 
>>> wrote: 
>>> > I definitely fork things and use "replace" quite frequently. 
>>> 
>>> It *can* be used, but it is not the solution in the general case as 
>>> Volker said. A replace in a library's go.mod file has no effect on 
>>> consumers of that library. 
>>> 
>>> https://go.dev/ref/mod#go-mod-file-replace: 
>>> 
>>> > replace directives only apply in the main module’s go.mod file and 
>>> are ignored in other modules. See Minimal version selection for 
>>> details. 
>>> 
> 
> -- 
> 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/bb56e11c-e6c5-425a-8243-df7929021014n%40googlegroups.com.

-- 
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/135F3BF8-8D03-4279-A201-F641CCD6120C%40ix.netcom.com.


Re: [go-nuts] Re: go install of forked repo

2023-05-03 Thread ged...@gmail.com
the original question was to do it from anywhere. that's also what i would 
like to do..

go install from anywhere... Not when you in a project with a go.work or 
go.mod etc etc

It's a pain that this is not supported.

On Monday, 5 December 2022 at 1:09:13 pm UTC+1 Robert Engels wrote:

> As I mentioned in the other thread - isn’t that made more complicated 
> because the module author (the module that is imported) doesnt use relative 
> packages references? If they did wouldn’t this be simpler?
>
> On Dec 5, 2022, at 5:32 AM, Brian Candler  wrote:
>
> Or there is vendoring .
>
>
>
> On Monday, 5 December 2022 at 09:16:24 UTC stephane@gmail.com wrote:
>
>> Hi, 
>>
>> If you don't want to commit *go.mod*, you can use *go.work 
>>  *https://go.dev/ref/mod#go-work-file
>>
>> On Monday, December 5, 2022 at 9:52:17 AM UTC+1 kortschak wrote:
>>
>>> On Sun, 2022-12-04 at 23:47 -0800, 'Christian Stewart' via golang-nuts 
>>> wrote: 
>>> > I definitely fork things and use "replace" quite frequently. 
>>>
>>> It *can* be used, but it is not the solution in the general case as 
>>> Volker said. A replace in a library's go.mod file has no effect on 
>>> consumers of that library. 
>>>
>>> https://go.dev/ref/mod#go-mod-file-replace: 
>>>
>>> > replace directives only apply in the main module’s go.mod file and 
>>> are ignored in other modules. See Minimal version selection for 
>>> details. 
>>>
>>> -- 
> 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...@googlegroups.com.
>
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/bb56e11c-e6c5-425a-8243-df7929021014n%40googlegroups.com
>  
> 
> .
>
>

-- 
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/84413305-52a6-4345-b2f7-f003570fedf2n%40googlegroups.com.