goutils/testutil/testutil.go

17 lines
329 B
Go
Raw Permalink Normal View History

2016-04-28 18:33:41 +00:00
package testutil
import "io/ioutil"
// TempName generates a new temporary file name. The caller should
// remove the temporary file when done.
func TempName() (string, error) {
tmpf, err := ioutil.TempFile("", "transport_cachedkp_")
if err != nil {
return "", err
}
name := tmpf.Name()
tmpf.Close()
return name, nil
}