Hi Brian,

I updated go.mod and all import paths in the main branch already, but the 
issue is related to installing releases (with go install) that had the old 
name in the go.mod.

On Friday, 26 May 2023 at 09:10:39 UTC+1 Brian Candler wrote:

> What happens if you change the go.mod file, and all imports within the 
> project, to use github.com/new/project instead of github.com/old/project ?
> (If you make this change, the issue then is whether you can still "go 
> install github.com/old/project...")
>
> The reason it works with a local clone is that you can put anything you 
> like in go.mod, even
>
>     module blahdiblah/dontcare
>
> and then do
>
>     import "blahdiblah/dontcare/foo"
>
> within the same local filetree.  The fact that the module name includes "
> github.com" doesn't require any access to github, if the module name can 
> be found within the local workspace.
>
> On Thursday, 25 May 2023 at 18:00:48 UTC+1 Tiago de Bem Natel de Moura 
> wrote:
>
>> Hi,
>>
>> I'd like to transfer a Go repository to another Github organization but 
>> somehow make the "go install" still able to install the old releases using 
>> the new import path. Is this possible?
>>
>> I did the transfer using the Github UI, and updated the go.mod and all 
>> imports to use the new project path, but now I'm unable to install the 
>> existing releases using the new import path.
>>
>> Example:
>>
>> works: go install github.com/old/project/c...@v1.0.0 
>> <http://github.com/old/project/cmd@v1.0.0>
>>
>> The "github.com/old/project" repository now automatically redirects to "
>> github.com/new/project" (Github Feature).
>>
>> But this fails: go install github.com/new/project/c...@v1.0.0 
>> <http://github.com/new/project/cmd@v1.0.0>
>>
>> error below:
>> go: github.com/new/project/c...@v1.0.0 
>> <http://github.com/new/project/cmd@v1.0.0>: github.com/new/pro...@v1.0.0 
>> <http://github.com/new/project@v1.0.0>: parsing go.mod:
>> module declares its path as: github.com/old/project
>>         but was required as: github.com/new/project
>>
>> If I clone the "github.com/new/project" repository then everything works 
>> fine (go build, go test, etc) but only "go install" fails...
>>
>> Is there a solution?
>>
>>
>>
>>

-- 
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/2dec895f-c2bf-4ed4-814b-d97b4ec47022n%40googlegroups.com.

Reply via email to