goo-proto/

directory
v1.2.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2024 License: Apache-2.0

README

命令

# brew install protobuf

# 安装必要的工具
go get -u google.golang.org/grpc@v1.68.0
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

# 设置环境变量
GOBIN=$(go env GOPATH)/bin
export PATH=$PATH:$GOBIN

# 生成 protobuf 代码
protoc \
    --proto_path=. \
    --go_out=paths=source_relative:. \
    --go-grpc_out=paths=source_relative:. \
    ./goo-proto/**/*.proto

使用说明

  • 导入包: import "goo-proto/v1/message.proto";
  • 使用message: goo.proto.v1.Empty
  • goland -> 语言和框架 -> Protocol Buffers -> import paths: $GOPATH/src/github.com/liqiongtao/googo.io

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL