golang modules – accessing local packages

Recently I was developing locally framework which I just wanted to test before pushing it anywhere to the clouds 🙂 It just so happens that testing when using modules is quite easy. The only thing you need to do is to update your go.mod file like that

module test-package

require github.com/abc/xyz v1.0.2
replace github.com/abc/xyz v1.0.2 => /Users/rafpe/xyz

From that point onward you can debug/make changes and try it all out before release.

Happy coding!


Leave a Reply

Your email address will not be published. Required fields are marked *