Golang 中国

go的web开发我们用的是gin和gorm然后结合微服务搞起来的在做的过程中我们也是采用了BDD的开发模式不知道大家都是怎么开发go的web应用的,想和大家一起交流下,由于在linux下开发go的也会遇到一些国外的包拉不下来,比如这个包 google.golang.org/grpc/transport
# google.golang.org/grpc/transport ../google.golang.org/grpc/transport/handler_server.go:220:12: undefined: http2.TrailerPrefix ../google.golang.org/grpc/transport/http2_client.go:1096:45: undefined: http2.MetaHeadersFrame ../google.golang.org/grpc/transport/http2_client.go:1217:9: undefined: http2.MetaHeadersFrame ../google.golang.org/grpc/transport/http2_server.go:232:45: undefined: http2.MetaHeadersFrame ../google.golang.org/grpc/transport/http2_server.go:411:9: undefined: http2.MetaHeadersFrame ../google.golang.org/grpc/transport/http_util.go:202:51: undefined: http2.MetaHeadersFrame ../google.golang.org/grpc/transport/http_util.go:486:6: f.fr.SetReuseFrames undefined (type *http2.Framer has no field or method SetReuseFrames) ../google.golang.org/grpc/transport/http_util.go:487:6: f.fr.ReadMetaHeaders undefined (type *http2.Framer has no field or method ReadMetaHeaders) ../google.golang.org/grpc/transport/http_util.go:617:13: f.fr.ErrorDetail undefined (type *http2.Framer has no field or method ErrorDetail)

3 回复
keke
#1 keke • 2017-09-08 16:09

由于最近一直在搞这个go微服务遇到问题了由于在linux下开发只能微信网页版去聊天,希望大神可以指点下。谢谢

jimmykuu
#2 jimmykuu • 2017-09-08 16:14

golang.org/x/xxx 包的手动安装方法:
golang.org/x/xxx 这类包托管在 github.com/golang,从这里找到相应的包即可。比如 golang.org/x/crypto 包的安装,找到对应的地址为: https://github.com/golang/crypto ,运行以下命令:

$ cd $GOPATH/src
$ mkdir golang.org
$ cd golang.org
$ mkdir x
$ cd x
$ git clone https://github.com/golang/crypto.git
sendltd
#3 sendltd • 2017-09-08 16:22

grpc已经从google…挪到https://github.com/grpc/grpc-go

用glide下载包,glide有镜像功能

glide mirror set https://golang.org/x/mobile https://github.com/golang/mobile --vcs git
glide mirror set https://golang.org/x/crypto https://github.com/golang/crypto --vcs git
glide mirror set https://golang.org/x/net https://github.com/golang/net --vcs git
glide mirror set https://golang.org/x/tools https://github.com/golang/tools --vcs git
glide mirror set https://golang.org/x/text https://github.com/golang/text --vcs git
glide mirror set https://golang.org/x/image https://github.com/golang/image --vcs git
glide mirror set https://golang.org/x/sys https://github.com/golang/sys --vcs git
需要 登录 后方可回复, 如果你还没有账号你可以 注册 一个帐号。

作者

keke
努力奋斗未来

发表话题

作者其它话题