Go Quiz exercise, part of Gophercises This is the first exercise from https://gophercises.com/.
Basically the idea is to parse a CSV file in a form of 'question:answer' and count the number of correct answers. Also you have a time out range in which you must finish it.
I would appreciate any comments, good or bad :) Thanks a lot !
package main

import (
        &quot;encoding/csv&quot;
        &quot;os&quot;
        &quot;fmt&quot;
        &quot;flag&quot;
        &quot;time&quot;
)

const Ready = &quot;yes&quot;

var correctAnswers int

func getFileContent(filename string) (records[][] string, err error) {
        fd, err := os.Open(filename)

        if err != nil {
                exit(&quot;Problem with opening the file&quot;)
        }

        reader := csv.NewReader(fd)
        return reader.ReadAll()
}

func outputResult(totalQuestions, correctAnswers int) {
        fmt.Println(&quot;Number of total questions:&quot;, totalQuestions)
        fmt.Println(&quot;Number of corrected answers:&quot;, correctAnswers)
}

func exit(message string) {
        fmt.Println(message)
        os.Exit(3)
}

func provideQuestions(questions[][] string, done chan bool) {
        for index, value := range questions {
                question, answer := value[0], value[1]
                fmt.Println(&quot;Question N:=&quot;, index+1, &quot;=&gt;&quot;, question)

                var userAnswer string
                fmt.Scanf(&quot;%s&quot;, &amp;userAnswer)

        if userAnswer == answer {
            correctAnswers ++
        }
        }

        done &lt;- true
}


func main() {
    fileName := flag.String(&quot;name of csv file&quot;, &quot;problems.csv&quot;, &quot;The name of the csv file - default to 'problems.csv'&quot;)
    allowedTime := flag.Int(&quot;allowed time&quot;, 10, &quot;The duration in seconds for which the quizz must be finished.&quot;)
    flag.Parse()

    var readyToStart string
    fmt.Println(&quot;Type 'yes' if you are ready to start&quot;)
    fmt.Scanf(&quot;%s&quot;, &amp;readyToStart)

    if readyToStart != Ready {
        fmt.Println(&quot;Come back later if you are ready&quot;)
        os.Exit(0)
    }

    records, err := getFileContent(*fileName)


    if err != nil {
            exit(&quot;Reader problem.&quot;)
    }
    

    done := make(chan bool)
    timer := time.NewTimer(time.Duration(*allowedTime) * time.Second)
    
    go provideQuestions(records, done)

    select {
    case &lt;- done:
            fmt.Println(&quot;Great job&quot;)
            fmt.Println(&quot;You finished with all questions.&quot;)
    case &lt;- timer.C:
            fmt.Println(&quot;Time expired&quot;)
        }

    outputResult(len(records), correctAnswers)

}
Your function returns error, but actually you don't return it and exit in the function body when opening the file:
func getFileContent(filename string) (records[][] string, err error) {
        fd, err := os.Open(filename)

        if err != nil {
                exit(&quot;Problem with opening the file&quot;)
        }

        reader := csv.NewReader(fd)
        return reader.ReadAll()
}

From the point of error handling it will be more consistent to return error:
fd, err := os.Open(filename)
if err != nil {
   return nil, err
}

The file was open, but not closed: defer fd.Close().
I don't remember flag package, but if it is not ensure the presence of parameter you need to check filename != nil:
records, err := getFileContent(*fileName)

Here you have created new goroutine, but returns the result via global variable correctAnswers:
done := make(chan bool)
go provideQuestions(records, done)

It stops working if you decide to improve your game and allow more than one person to play on the same time. You will have race condition on this variable. Much better return the value from goroutine using channel.
You already have such channel - done, just change its type to channel of int and return the number of correct answers using it.