zoukankan      html  css  js  c++  java
  • go安装grpc

    go安装grpc

    GOPATH 添加 d:grpc

    下载grpc及依赖库

    git clone https://github.com/grpc/grpc-go ./google.golang.org/grpc

    git clone https://github.com/golang/net.git ./golang.org/x/net

    git clone https://github.com/google/go-genproto.git ./google.golang.org/genproto

    git clone https://github.com/golang/text.git ./golang.org/x/text

    git clone https://github.com/protocolbuffers/protobuf-go.git ./google.golang.org/protobuf

    安装grpc

    go install google.golang.org/grpc

    基本上go install没有提示错误,grpc就算安装好了,我们现在拿grpc里的example来测试


    // 先启动server

    d:grpcsrc>go run google.golang.org/grpc/examples/helloworld/greeter_server/main.go
    2021/09/11 16:27:46 server listening at [::]:50051

    //后启动client

    D:grpcsrc>go run google.golang.org/grpc/examples/helloworld/greeter_client/main.go
    2021/09/11 16:29:08 Greeting: Hello world

    生成protoc-gen-go.exe

    go install google.golang.org/protobuf/cmd/protoc-gen-go/

  • 相关阅读:
    【项目】项目41
    【项目】项目40
    【项目】项目39
    【项目】项目38
    【项目】项目37
    15-155. Min Stack
    14-160. Intersection of Two Linked Lists
    13-169. Majority Element
    12-206. Reverse Linked List
    11-215. Kth Largest Element in an Array
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/15255572.html
Copyright © 2011-2022 走看看