Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Unified Diff: common/tsmon/field/field.go

Issue 1857643003: Revert of Migrate tsmon protos to proto3 (Closed) Base URL: git@github.com:luci/luci-go.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « common/tsmon/context.go ('k') | common/tsmon/field/field_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common/tsmon/field/field.go
diff --git a/common/tsmon/field/field.go b/common/tsmon/field/field.go
index 8b1681e3b3235558489cef490a92b05d472a4af7..3cc7b806b8eff0b8b6a7ea100f59f78ca17690b3 100644
--- a/common/tsmon/field/field.go
+++ b/common/tsmon/field/field.go
@@ -6,6 +6,8 @@
import (
"fmt"
+
+ "github.com/golang/protobuf/proto"
pb "github.com/luci/luci-go/common/tsmon/ts_mon_proto"
)
@@ -38,17 +40,17 @@
for i, f := range fields {
d := &pb.MetricsField{
- Name: f.Name,
- Type: f.Type,
+ Name: proto.String(f.Name),
+ Type: f.Type.Enum(),
}
switch f.Type {
case pb.MetricsField_STRING:
- d.StringValue = values[i].(string)
+ d.StringValue = proto.String(values[i].(string))
case pb.MetricsField_BOOL:
- d.BoolValue = values[i].(bool)
+ d.BoolValue = proto.Bool(values[i].(bool))
case pb.MetricsField_INT:
- d.IntValue = values[i].(int64)
+ d.IntValue = proto.Int64(values[i].(int64))
}
ret[i] = d
« no previous file with comments | « common/tsmon/context.go ('k') | common/tsmon/field/field_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698