Files
kata-containers/cmd/kata-pkgsync/cli/utils.go
Marco Vedovati 1cd267af43 kata-pkgsync: Add OBS to Packagecloud sync tool
Add kata-pkgsync as the OBS to Packagecloud sync tool.

Fixes: #506

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-05-17 12:05:55 +02:00

27 lines
447 B
Go

// Copyright (c) 2019 SUSE LLC
//
// SPDX-License-Identifier: Apache-2.0
//
package main
import (
"fmt"
"io/ioutil"
"github.com/pkg/errors"
"gopkg.in/yaml.v2"
)
func yamlUnmarshal(yamlFile string, cfg interface{}) error {
source, err := ioutil.ReadFile(yamlFile)
if err != nil {
return err
}
err = yaml.Unmarshal(source, cfg)
if err != nil {
return errors.Wrapf(err, fmt.Sprintf("cannot unmarshal %s", yamlFile))
}
return nil
}