Add error check to temporary files

This commit is contained in:
andrew 2020-03-09 12:36:29 +02:00
parent 5f6871027f
commit 6c1f33628b

View File

@ -53,6 +53,7 @@ func main() {
// `TempFile`'s, but it returns a directory *name*
// rather than an open file.
dname, err := ioutil.TempDir("", "sampledir")
check(err)
fmt.Println("Temp dir name:", dname)
defer os.RemoveAll(dname)