pulumi/pkg/encoding/init.go
joeduffy 5f33292496 Move assertion/failure functions
This change just moves the assertion/failure functions from the pkg/util
package to pkg/util/contract, so things read a bit nicer (i.e.,
`contract.Assert(x)` versus `util.Assert(x)`).
2017-01-15 14:26:48 -08:00

25 lines
502 B
Go

// Copyright 2016 Marapongo, Inc. All rights reserved.
package encoding
import (
"github.com/marapongo/mu/pkg/util/contract"
)
func init() {
// Ensure a marshaler is available for every possible Mufile 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.FailMF("No Marshaler available for MufileExt %v", ext)
}
}
}