在Windows上安装GRPC

huangapple go评论136阅读模式
英文:

Installing GRPC in Windows

问题

我只是简单地将以下代码写入CMD中,

set PATH="$PATH:$(go env GOPATH)/bin"

不知道我是否做了明智的事情。

我只是因为使用的是Windows,所以将expose替换为set

要成功完成安装,接下来应该做什么?

你能提供一下你如何安装它,就像你的电脑上的原始字符串一样,不包含任何shell变量吗?因为我对Shell还不太熟悉。

英文:

I simply write the following code to the CMD,

set PATH="$PATH:$(go env GOPATH)/bin"

and don't know whether I do something sensible or not.

I just replaced expose with set because of Windows.

What should be done next to complete the installation successfully?

Could you provide how you would install it as if it were your PC as a raw string without any shell variable? Because I'm not comfortable with Shell yet.

答案1

得分: 1

对于每个来到这里的人:

首先,你应该下载最新版本的协议缓冲区:

这个链接下载并安装你想要的版本,比如:protoc-3.19.3-win64.zip

之后,将你安装的二进制路径添加到环境变量中(有关添加到环境变量的更多信息,请参见这个链接

然后,你需要为你想要的语言安装proto编译器。在这个例子中,我选择了go

> $ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26
> $ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1

注意:GOPATH应该在环境变量中,还有GOPATH/bin

英文:

For everyone who comes here:

  • first of all, you should download the latest version of the protocol buffer:

    download from this link and install the version that you want, like: protoc-3.19.3-win64.zip

    after that add the binary path that you installed on the path environment. ( for more information about adding to path environment see this link)

  • after that you need to install the proto compiler for the language you want. in this example I choose go:

> $ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26
> $ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1

Note: The GOPATH should be in environments. also GOPATH/bin.

huangapple
  • 本文由 发表于 2022年1月9日 23:45:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/70642919.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定