gin框架和micro对接代码问题
1. 运行环境
go version go1.22.1 windows/amd64
2. 问题描述?
service.Client()标红不能解决
3. 您期望得到的结果?
成功运行
4. 您实际得到的结果?
//: Cannot use ‘service.Client()’ (type “github.com/micro/go-micro/v2/client”.Client) as the type “github.com/micro/go-micro/client”.ClientType does not implement ‘client.Client’ as some methods are missing:Init(…Option) erro
需要指针类型,类似这样:
Client() 返回的是结构体,非指针的时候,接口没有实现,只有指针时实现了接口,所以用指针