Creating a csv file

Report a typo

Lena is a very curious programmer, she wants to know if she can create other types of files apart from .txt files using the os package.

Help Lena write the required additional code to create a new file numbers.csv using the correct functions from the os package. Below is the code Lena has written so far:

Write a program
package main

import (
"log"
"os"
)

func main() {
// Write the additional required code to create the file "numbers.csv" below:
?, err := os.?("?")

// Do not delete the code block below! It is required for proper error handling!
if err != nil {
log.Fatal(err)
}
file.Close() // DO NOT DELETE THIS LINE! Always remember to close the file!
}
___

Create a free account to access the full topic