pulumi/pkg/encoding/init.go

25 lines
524 B
Go
Raw Normal View History

2017-06-26 23:46:34 +02:00
// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
package encoding
import (
"github.com/pulumi/pulumi-fabric/pkg/util/contract"
)
func init() {
// Ensure a marshaler is available for every possible Lumifile 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 LumifileExt %v", ext)
}
}
}