pulumi/pkg/encoding/init.go
2017-03-14 19:26:14 -07:00

25 lines
504 B
Go

// Copyright 2017 Pulumi, Inc. All rights reserved.
package encoding
import (
"github.com/pulumi/coconut/pkg/util/contract"
)
func init() {
// Ensure a marshaler is available for every possible Cocofile extension
Marshalers = make(map[string]Marshaler)
for _, ext := range Exts {
switch ext {
case ".json":
Marshalers[ext] = JSON
case ".yml":
fallthrough
case ".yaml":
Marshalers[ext] = YAML
default:
contract.Failf("No Marshaler available for CocofileExt %v", ext)
}
}
}