func CreateTestFile(c *C, fileName string, contents []byte, perm os.FileMode) string {
	topDir := c.MkDir()
	filePath := filepath.Join(topDir, "file")
	if err := ioutil.WriteFile(filePath, contents, perm); err != nil {
		c.Fatal(err)
	}
	return filePath
}
// This creates a file named fileName in a temporary directory
// specifically created for this file. The contents are then
// written to the file. This file will be deleted at the end
// of a test. If creation of the file fails, the test will be
// aborted. The method will return the full path to the created
// file.
This creates a file named fileName in a temporary directory
specifically created for this file. The contents are then
written to the file. This file will be deleted at the end
of a test. If creation of the file fails, the test will be
aborted. The method will return the full path to the created
file.
// This creates a file named fileName in a temporary directory // specifically created for this file . The contents are then // written to the file . This file will be deleted at the end // of a test . If creation of the file fails the test will be // aborted . The method will return the full path to the created // file .
func CreateTestFile(c *C, fileName string, contents []byte, perm os.FileMode) string {
	topDir := c.MkDir()
	filePath := filepath.Join(topDir, "file")
	if err := ioutil.WriteFile(filePath, contents, perm); err != nil {
		c.Fatal(err)
	}
	return filePath
}
func CreateTestFile ( c * C , fileName string , contents [ ] byte , perm os . FileMode ) string { topDir := c . MkDir ( ) filePath := filepath . Join ( topDir , " " ) if err := ioutil . WriteFile ( filePath , contents , perm ) ; err != nil { c . Fatal ( err ) } return filePath }
This creates a file named fileName in a temporary directory
specifically created for this file.
This creates a file named fileName in a temporary directory specifically created for this file .