ipld-eth-server/vendor/github.com/aristanetworks/goarista/test/fileutil.go
Matt K 293dd2e848 Add vendor dir (#16) (#4)
* Add vendor dir so builds dont require dep

* Pin specific version go-eth version
2018-01-29 13:44:18 -06:00

30 lines
517 B
Go

// Copyright (c) 2015 Arista Networks, Inc.
// Use of this source code is governed by the Apache License 2.0
// that can be found in the COPYING file.
package test
import (
"io"
"os"
"testing"
)
// CopyFile copies a file
func CopyFile(t *testing.T, srcPath, dstPath string) {
src, err := os.Open(srcPath)
if err != nil {
t.Fatal(err)
}
defer src.Close()
dst, err := os.Create(dstPath)
if err != nil {
t.Fatal(err)
}
defer dst.Close()
_, err = io.Copy(dst, src)
if err != nil {
t.Fatal(err)
}
}