1

I have import statements in my code that look like this:

import "github.com/A/package"

It turns out that - temporarily - I need to use github.com/B/package.

Rather than modify the source, and re-modify it later, is there a way to specify an override?

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189

1 Answers1

1

Since Go1.11, modules allow the use of the replace directive in the go.mod file of the project. It allows to override an expressed dependency by another module.

Online reference is https://github.com/golang/go/wiki/Modules#when-should-i-use-the-replace-directive