veyron2/vdl: Add native type support to Go code generation.
The support for native types already exists in the Go libraries;
vdl.Register already captures the native type via reflection, and
value conversion respects the native types.
This CL adds the final piece, which is special-cased code
generation for native types. This allows us to start using
native types, e.g. the standard "time" package.
MultiPart: 1/5
Change-Id: Ie5e8b48938feffddbae93e435918574b79a50c91
diff --git a/runtimes/google/ipc/stream/proxy/protocol.vdl.go b/runtimes/google/ipc/stream/proxy/protocol.vdl.go
index 226ecd4..818fc20 100644
--- a/runtimes/google/ipc/stream/proxy/protocol.vdl.go
+++ b/runtimes/google/ipc/stream/proxy/protocol.vdl.go
@@ -35,6 +35,6 @@
}
func init() {
- vdl.Register(Request{})
- vdl.Register(Response{})
+ vdl.Register((*Request)(nil))
+ vdl.Register((*Response)(nil))
}
diff --git a/security/serialization/types.vdl.go b/security/serialization/types.vdl.go
index 5946e77..dc1df3e 100644
--- a/security/serialization/types.vdl.go
+++ b/security/serialization/types.vdl.go
@@ -67,7 +67,7 @@
func (x SignedDataHash) __VDLReflect(__SignedDataReflect) {}
func init() {
- vdl.Register(SignedHeader{})
- vdl.Register(HashCode{})
- vdl.Register(SignedData(SignedDataSignature{security.Signature{}}))
+ vdl.Register((*SignedHeader)(nil))
+ vdl.Register((*HashCode)(nil))
+ vdl.Register((*SignedData)(nil))
}
diff --git a/services/mgmt/profile/profile.vdl.go b/services/mgmt/profile/profile.vdl.go
index 331db64..551f8e2 100644
--- a/services/mgmt/profile/profile.vdl.go
+++ b/services/mgmt/profile/profile.vdl.go
@@ -52,6 +52,6 @@
}
func init() {
- vdl.Register(Library{})
- vdl.Register(Specification{})
+ vdl.Register((*Library)(nil))
+ vdl.Register((*Specification)(nil))
}
diff --git a/services/mgmt/stats/types.vdl.go b/services/mgmt/stats/types.vdl.go
index 29422e8..9b70297 100644
--- a/services/mgmt/stats/types.vdl.go
+++ b/services/mgmt/stats/types.vdl.go
@@ -42,6 +42,6 @@
}
func init() {
- vdl.Register(HistogramValue{})
- vdl.Register(HistogramBucket{})
+ vdl.Register((*HistogramValue)(nil))
+ vdl.Register((*HistogramBucket)(nil))
}
diff --git a/tools/vrpc/test_base/test_base.vdl.go b/tools/vrpc/test_base/test_base.vdl.go
index e49f151..f92f135 100644
--- a/tools/vrpc/test_base/test_base.vdl.go
+++ b/tools/vrpc/test_base/test_base.vdl.go
@@ -30,8 +30,8 @@
}
func init() {
- vdl.Register(Struct{})
- vdl.Register(Array2Int{})
+ vdl.Register((*Struct)(nil))
+ vdl.Register((*Array2Int)(nil))
}
// TypeTesterClientMethods is the client interface