I've been trying to learn about Go's built-in testing framework and getting proper test coverage.

In one of the files I'm testing I'm only getting ~87% coverage:

coverage: 87.5% of statements

Here's a section of the code covered in the test:

// Check that the working directory is set
if *strctFlags.PtrWorkDir == "" {

// if the working directory is empty, set it to the current directory
strTemp, err := os.Getwd()
if err != nil {
    return "", errors.New("Could not get current working directory")
}

*strctFlags.PtrWorkDir = strTemp

} else if stat, err := os.Stat(*strctFlags.PtrWorkDir); err != nil ||
!stat.IsDir() {

    // Existence check of the work dir
    return "", errors.New("Specified directory \"" + *strctFlags.PtrWorkDir + "\" could not be found or was not a directory")
}

*strctFlags.PtrWorkDir, err = filepath.Abs(*strctFlags.PtrWorkDir)
if err != nil {
    return "", errors.New("Could not determine absolute filepath: " + err.Error())
}

The parts not covered in the test according to the .out file are the "if err != nil {}" blocks, which would be errors returned from standard library calls.

While I think the likelihood of the standard library passing errors would be slim unless there would be hardware failure, I think it would be good to know that the error is handled in the application properly. Also, checking returned errors is, to my understanding, idiomatic Go so I would think it would be good to be able to test error handling properly.

How do people handle testing errors like the situations above? Is it possible to get 100% coverage, or am I doing or structuring something incorrectly? Or do people skip testing those conditions?