Skip to content

Instantly share code, notes, and snippets.

@alltom
Created December 29, 2020 19:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alltom/42519d80c477ceba65826fc5b7ed579a to your computer and use it in GitHub Desktop.
Save alltom/42519d80c477ceba65826fc5b7ed579a to your computer and use it in GitHub Desktop.
Go proto example
// file path: myproject/proto/msg1/generate.go
package proto
//go:generate protoc -I/usr/local/include -I. -I$GOPATH/src -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --go_out=plugins=grpc:. msg1.proto
// file path: myproject/libfoo/libfoo.go
package libfoo
import (
pb1 "todinspiration/proto/msg1"
)
type Foo *pb1.Msg1
// file path: myproject/proto/msg1/msg1.proto
syntax = "proto3";
package myproject.msg1;
option go_package = "proto";
import "myproject/proto/msg2/msg2.proto";
message Msg1 {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment