Skip to content

Latest commit

 

History

History
23 lines (15 loc) · 573 Bytes

protocal-buffers.md

File metadata and controls

23 lines (15 loc) · 573 Bytes

Protocol Buffers

proto2 和 proto3 的差别

protoc-gen-lint 报错 "Timestamp" is not defined

You need to 'import "google/protobuf/timestamp.proto";' before using it. Also the name of the type is "google.protobuf.Timestamp".

protocolbuffers/protobuf#991 (comment)

例子,(这里再举一个 any 的例子)

syntax = "proto3";

import "google/protobuf/any.proto";
import "google/protobuf/timestamp.proto";

message Message {
  google.protobuf.Timestamp time = 1;
  google.protobuf.Any data = 2;
}