On Wed, Aug 19, 2020 at 12:12 PM 'K Richard Pixley' via golang-nuts <
golang-nuts@googlegroups.com> wrote:

> I have two local git repositories.  Both are go modules.  Call them,
> foo.com/one and foo.com/two.  Both have go.mod files declaring themselves
> to be, respectively, foo.com/one and foo.com/two based on go 1.15.
>
> I want to use a package from one in the other.
>
> import "foo.com/one/pkg/thing1"
>
> Short of publishing one of them on github, how do I do that?  Do I need to
> copy or symlink something?  Set some environment variables?
>

See the "replace" directive in
https://golang.org/cmd/go/#hdr-The_go_mod_file. Google "go mod replace
local path" and you'll find plenty of articles on this topic, such as
https://thewebivore.com/using-replace-in-go-mod-to-point-to-your-local-module/



-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

-- 
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/CABx2%3DD8bXPLnZ8KKfqOL3zWVr7q%3DXdY7kz-zEiWQuZddd9CAtg%40mail.gmail.com.

Reply via email to