Quiz: Working with Files in Go

Test your knowledge of working with files in Go

1

What is the correct syntax to create a temporary file in Go?

A)

temp, err = os.OpenFile("temp.txt", os.TEMP, 0644)

B)

temp, err := ioutil.TempFile("", "*.txt")

C)

temp := ioutil.TempFile("", "*.txt")

D)

temp, err := ioutil.ReadFile(temp)

Question 1 of 50 attempted

Get hands-on with 1400+ tech skills courses.