ElfsЯUs
ElfsЯUs

Reputation: 1218

Change the root directory of Go project to not be src

Ahoy,

We have a large monolithic repository with all our code in it. We have recently started to use Go, however, are having issues since most tooling for Go assumes that the root directory is src/ but ours is not. Our directory structure is based on product areas and not based on language or tooling. We don't want to have a separate directory just for Go.

How can we setup the Go path to not assume that the directory starts at src?

Thanks!

Upvotes: 1

Views: 641

Answers (1)

VonC
VonC

Reputation: 1328522

The safest course of action is to have two worktrees:

  • one for your current directory structure, based on product areas
  • one for Go development respecting GOPATH

Each time you will make a commit in the second worktree, you can git pull/update your first worktree to keep it up-to-date.

Upvotes: 1

Related Questions