关于golang:golang-goplugins-http请求错误

1.谬误1

go build github.com/lucas-clemente/quic-go/internal/qtls: build constraints exclude all Go files in C:\Users\admin\go\pkg\mod\github.com\lucas-clemente\quic-go@v0.22.0\internal\qtls
FAIL    gomicro-demo2 [build failed]

解决办法

go.mod中的quic-go正文掉
// github.com/lucas-clemente/quic-go v0.22.0 // indirect

2.谬误2

cannot use client.ContentType("application/json") (value of type client.Option) as client.Option value in argument to phttp.NewClient

解决办法

go-micro版本不统一,批改为统一

"github.com/micro/go-micro/v2/client"
"github.com/micro/go-micro/v2/client/selector"
"github.com/micro/go-micro/v2/registry"
 phttp "github.com/micro/go-plugins/client/http/v2" 
"github.com/micro/go-plugins/registry/consul/v2"

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理