Goland shows a underline in a err variable without explaining why/no tooltip for the underline cause (see image below -- the arrow points to the weird underline).
Does anyone know the cause for the underline?
(It does not seem to be because the err is defined a few lines above because I have similar err reuse in other files and there is no underline in them).
Here is the code, although this question would make no sense without an explaining picture from the IDE because this seems to be a bug in Goland.
package mypack
import (
"fmt"
"os"
)
func SomeFunc() (string, error) {
err := GetSomething()
if err != nil {
return "", fmt.Errorf("some err")
}
currentDirectory, err := os.Getwd()
if err != nil {
return "", fmt.Errorf("error getting current dir. %v", err)
}
return currentDirectory, nil
}
func GetSomething() error {
return nil
}