golang module imports from keybase repo or locally

Viewed 38

I know it must be a very basic question, but i don't seem to be able to get around it for a while :D

So, my git repo is on keybase. normally external or local imports are looking like "github.com/streadway/amqp" How can a import a module from keybase git repo? Or, how do i import it as local module? The absolute path is /Users/****/go/src/api

1 Answers

If I understand your question correctly You have 2 questions, the first one is you are looking to add a package from a private repository. the second is you want to use a package from another path.

  • for question one, you can see this answer and change it for your keybase

  • for the second one, you can add replace in your go.mod file.

like this:

replace (
    the/package/address => ../../****/path/to/package
)

notice: the replace path should be routed from your go.mod file.

Related