tempfile.go
func CreateFile(filename string, size int64) error {

	buf := make([]byte, size)

	// Create the file store some data
	fp, err := os.Create(filename)
	if err != nil {
		return err
	}

	// Write the buffer
	_, err = fp.Write(buf)

	// Cleanup
	fp.Close()

	return err
}
func CreateFile(filename string, size int64) error {

	buf := make([]byte, size)

	// Create the file store some data
	fp, err := os.Create(filename)
	if err != nil {
		return err
	}

	// Write the buffer
	_, err = fp.Write(buf)

	// Cleanup
	fp.Close()

	return err
}
// We could use Fallocate, but some test CI systems
// do not support it, like Travis-ci.org.