Skip to content

Commit

Permalink
Fix FloatValue/DoubleValue protobuf types handling (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniil Kukharau authored Feb 1, 2019
1 parent 5dd996c commit acb2249
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 81 deletions.
177 changes: 98 additions & 79 deletions example/feature_demo/demo_types.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions example/feature_demo/demo_types.pb.gorm.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions example/feature_demo/demo_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ message TypeWithID {
APIOnlyType synthetic_field = 9;
float tag_test = 10 [(gorm.field).tag = {type: "float" , precision: 6}];
string tag_size_test = 11 [(gorm.field).tag = {size: 512}];
google.protobuf.FloatValue float_field = 12;
google.protobuf.DoubleValue double_field = 13;
}

// MultiaccountTypeWithID demonstrates the generated multi-account support
Expand Down
4 changes: 2 additions & 2 deletions plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ const (

var wellKnownTypes = map[string]string{
"StringValue": "*string",
"DoubleValue": "*double",
"FloatValue": "*float",
"DoubleValue": "*float64",
"FloatValue": "*float32",
"Int32Value": "*int32",
"Int64Value": "*int64",
"UInt32Value": "*uint32",
Expand Down

0 comments on commit acb2249

Please sign in to comment.