I have A.go file with a method as follows.
func pInfoEx(reqCtx B.RequestContext) {
fmt.Println(reqCtx.p);
}
For this RequestContext argument in the pInfoEx function I have to import the B.go file which is in another package.
type RequestContext interface {
p() string
}
But B.go imports C.go which inturn imports A.go creating cyclic dependency. How can I go about resolving this cyclic dependency without moving go files to the same package?
I have gone through Cyclic dependencies and interfaces in Golang post, but here the method has an argument which cannot be changed.