type Req struct {
apiVersion string
path string
resourceEndpoint string
accessKey string
log *logrus.Entry
incomingReq interface{}
httpClient lib.HTTPClient
redisClient redis.Cmdable
ctx context.Context
}
type TestReq struct {
Req
}
According to this this question and its answers, I feel like I should be able to do the following:
req := &Req{}
req = TestReq(req)
But I get this error in VsCode:
cannot convert req (variable of type *Req) to TestReq compiler(InvalidConversion)
Don't these two structs have the same underlying fields? If so, why can't the first be converted into the second?