Created
December 29, 2020 19:10
-
-
Save alltom/42519d80c477ceba65826fc5b7ed579a to your computer and use it in GitHub Desktop.
Go proto example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// file path: myproject/libfoo/libfoo.go | |
package libfoo | |
import ( | |
pb1 "todinspiration/proto/msg1" | |
) | |
type Foo *pb1.Msg1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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