protoc-gen-gorm
protoc-gen-gorm copied to clipboard
Google's timestamppb only imported for side effects in generated file.
Just using the google.protobuf.Timestamp
in a message causes timestamppb to be imported but only for side effects _ "google.golang.org/protobuf/types/known/timestamppb"
. This causes build errors as this package is referenced in the code when dealing with these properties. Removing the generated _
completely solves the issue but this is such a common use case I'm wondering if I'm doing something wrong.
import "google/protobuf/timestamp.proto";
message MyMessage {
...
google.protobuf.Timestamp start_time = 3;
string preferences = 4 [(gorm.field).tag = {not_null: true}];
...
}
Is there any way to force this to import? I'm on Go 1.17x if it's important. And building with buf