1
0
mirror of https://github.com/rancher/os.git synced 2025-08-31 22:32:14 +00:00

ros install

This commit is contained in:
Ivan Mikushin
2015-08-18 19:07:00 +05:00
parent ab59d3cc64
commit e486b7e218
6 changed files with 152 additions and 2 deletions

View File

@@ -152,6 +152,25 @@ func RandSeq(n int) string {
return string(b)
}
func FileCopy(src, dest string) (err error) {
in, err := os.Open(src)
if err != nil {
return err
}
defer func() { err = in.Close() }()
out, err := os.Create(dest)
if err != nil {
return err
}
defer func() { err = out.Close() }()
if _, err := io.Copy(out, in); err != nil {
return err
}
return
}
func Convert(from, to interface{}) error {
bytes, err := yaml.Marshal(from)
if err != nil {