New Copy Function
This commit is contained in:
parent
13b07bf7f7
commit
0bd47c5d3f
14
utils.go
14
utils.go
@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"strconv"
|
||||
"strings"
|
||||
"syscall"
|
||||
@ -94,3 +95,16 @@ func formatString(a interface{}) string {
|
||||
return "Paused"
|
||||
}
|
||||
}
|
||||
|
||||
func Copy(sourceImage, destinationImage string) error {
|
||||
source, err := ioutil.ReadFile(sourceImage)
|
||||
if err != nil {
|
||||
return err
|
||||
} else {
|
||||
err = ioutil.WriteFile(destinationImage, source, 0644)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user