0

I have a github structure like :

group_name/Project_dir/Project_subdir which looks like this git@github.com:group_name/project_dir/subdir.git on github . I'm trying to use go-get to get the project but it treats go get github.com/group_name/project_dir/subdir like group_name/project_dir.git and fails.

I have done go get github.com/group_name/project_dir/subdir.git but it pulls the code to subdir.git folder.

Is there any other way to get this code in subdir folder apart from manually doing mv subdir.get subdir ?

abhishek627
  • 138
  • 2
  • 10
  • Why have you structured it this way? If you want to use the standard tools, you need to follow the same guidelines that the tools use. – JimB May 24 '19 at 19:57
  • Also *how* have you structured it this way? I didn't think github would let you do that unless it's a git submodule, in which case you'd probably need to import it using the original git repo URL instead of pointing at the submodule. – Adrian May 24 '19 at 20:37
  • @JimB In my company, we have a common project, inside that we have different directories referring to whether it is infrastructure code or service code, inside service dir, we have all the individual services. Is that the wrong structure to maintain the code ? What would you suggest in this case? – abhishek627 May 25 '19 at 03:56
  • @Adrian I used github as an example because I thought it would be similar for all version controls. I'm using gitlab for company actually. And that allows this structure. – abhishek627 May 25 '19 at 03:59
  • @Maruf Tuhin In go module usage page, I read that we should not do init in subdir but at dir level. Is that correct ? – abhishek627 May 25 '19 at 04:05
  • 1
    @abhishek627, seems like, that is correct. Whenever you run `go mod init`, it will consider it as a root directory and it will create a `go.mod` on that path. So, you need to be on root of a project while initializing go mod. – Abdullah Al Maruf - Tuhin May 25 '19 at 13:17

0 Answers0