In my go app(parent), I import a go library(child) through go get and copy it to the parent directory. For my use, I make some modifications in "child" for extending certain features. I use go module and use "replace" in go.mod to point to the local child(with extended features) path instead of the global $GOPATH.
I am confused how to constantly keep the child in sync with its upstream repo, while retaining my extended features.
//App directory
Parent.go
--Child/ (copied from $GOPATH)
go.mod
//go.mod
replace github.com/xyz/child => ./Child
Setting up the child as a git-submodule works well in my system. But when the repo is pulled from another system, the child picks up it's go dependencies from $GOPATH
from past versions and doesn't map to the correct version.
I an trying to setup git-submodule and go-module to work seamlessly for my app in any environment. I am trying to resolve this for more than a week now. Please help.