I have a project set up as such:
myproject
loadoptions
loadoptions.go
go.mod
backstack
backstack.go
go.mod
thirdthing
thirdthing.go
go.mod
//Lots of irrelevant stuff, bla bla bla
There is a structure defined in thirdthing.go, used in loadoptions.go, then the function from loadoptions is called in backstack. Each is replaced in go.mod, so that these local files are included instead of the gitlab downloaded version. I added an element to the struct in thirdthing, then tried to build backstack. This fails because it doesn’t recognize the new element. I ran go build in the loadoptions directory and it works. Running go mod tidy in all directories doesn’t seem to work either.
I copied the error below:
../loadoptions/loadoptions.go:107:11: retDat.LoggerFailKillProcess undefined (type imgProc.ConfigOptions has no field or method LoggerFailKillProcess)
UPDATE:
My internet was out. I pushed the change to the struct before it went out, and, once it came back go build downloaded the changed version. I clearly have some issue with my replace directive in go.mod. Weirdly enough, it’s working now.