kubeconform/pkg/resource/resource.go
2020-10-27 18:42:13 +01:00

17 lines
266 B
Go

package resource
import (
"sigs.k8s.io/yaml"
)
type Resource struct {
Path string
Bytes []byte
Err error
}
func (r Resource) AsMap() (map[string]interface{}, error) {
var res map[string]interface{}
err := yaml.Unmarshal(r.Bytes, &res)
return res, err
}