Reputation: 4297
I have this struct in golang
struct File {
name string
creatation_time time.Time
}
How do I write it in protobuf3 ?
Upvotes: 5
Views: 2692
Reputation: 86
Create example.proto;
syntax = "proto3";
import google_protobuf "github.com/golang/protobuf/ptypes/timestamp"
message File {
string name = 1;
google.protobuf.Timestamp creatation_time = 2;
}
After compilation check the example.pb.go for the structure definition that has been created.
Upvotes: 4