https://github.com/ironcore864/protobuf-example
https://github.com/ironcore864/protobuf-example
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ironcore864/protobuf-example
- Owner: IronCore864
- Created: 2019-11-27T15:50:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-27T16:20:53.000Z (over 6 years ago)
- Last Synced: 2025-05-24T15:44:24.360Z (about 1 year ago)
- Language: Go
- Size: 3.91 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# protobuf-example
Golang protobuf example
## Protobuf Compiler Installation
The simplest way to install the protocol compiler is to download a pre-built binary from the official release page:
https://github.com/protocolbuffers/protobuf/releases
Make sure the protoc binary is in your path.
## Install the Proto Package
The simplest way is to run:
```
go get -u github.com/golang/protobuf/protoc-gen-go
```
## Compile
```
SRC_DIR=$(pwd)/pb
DST_DIR=$(pwd)/pb
protoc -I=$SRC_DIR --go_out=$DST_DIR $SRC_DIR/addressbook.proto
```
## Build Project
```
go build
```
## Write/Read Example
```
./protobuf-example write
./protobuf-example read
```