1

I have 2 go projects in one repository that need the same package and I'm trying to avoid having two copies of them.

/myRepo
  /project_1
    go.mod
    /myPackage
      /file1.go
      /file2.go
  /project_2
    go.mod
    /symLinkToMyPackageAbove

Although copying the entire package works, the symlink doesn't seem to work. Does go support this or is there another way to create a symlink (I created one using ln -s /path/to/source /path/to/destination)

  • 3
    Review the getting started tutorial https://go.dev/doc/tutorial/ It will describe how to import modules. Abandon this symlink thing and use the modules the way they were meant to be used to share functionality between projects – erik258 Dec 02 '21 at 03:21

0 Answers0