coreos/yaml — pull request #1 by crawford (2014-12-21 01:35:54+00:00)
Title: WIP - Add mapping transform hook

This hook allows the user to transform map names (e.g. replace '-' with '_').

The coresponding code in config/config.go looks like:

```diff
config/config.go | 48 ++++++++++++------------------------------------
1 file changed, 12 insertions(+), 36 deletions(-)

diff --git a/config/config.go b/config/config.go
index 9278ecc..e0e4903 100644
--- a/config/config.go
+++ b/config/config.go
@@ -46,6 +46,16 @@ type CloudConfig struct {
NetworkConfig string `yaml:"-"`
}

+type TransformOpenStack struct{}
+
+func (t *TransformOpenStack) Transform(in string) (out string) {
+	return strings.Replace(in, "-", "_", -1)
+}
+
+func init() {
+	yaml.UnmarshalMappingTransform = &TransformOpenStack{}
+}
+
```