Add custom conversion function system.

As an example, demonstrate how Env.Key's deprecation ought to work.
This commit is contained in:
Daniel Smith
2014-07-28 15:13:17 -07:00
parent dc6fdc423d
commit 242c8cdaec
9 changed files with 379 additions and 257 deletions

View File

@@ -44,10 +44,6 @@ func convert(obj interface{}) (interface{}, error) {
func init() {
api.AddKnownTypes("", Simple{}, SimpleList{})
api.AddKnownTypes("v1beta1", Simple{}, SimpleList{})
api.AddExternalConversion("Simple", convert)
api.AddInternalConversion("Simple", convert)
api.AddExternalConversion("SimpleList", convert)
api.AddInternalConversion("SimpleList", convert)
}
// TODO: This doesn't reduce typing enough to make it worth the less readable errors. Remove.