19 lines
435 B
Go
19 lines
435 B
Go
package errors
|
|
|
|
import "fmt"
|
|
|
|
// UnknownIdentifier represents unknown variables.
|
|
type UnknownIdentifier struct {
|
|
Name string
|
|
CorrectName string
|
|
}
|
|
|
|
// Error generates the string representation.
|
|
func (err *UnknownIdentifier) Error() string {
|
|
if err.CorrectName != "" {
|
|
return fmt.Sprintf("Unknown identifier '%s', did you mean '%s'?", err.Name, err.CorrectName)
|
|
}
|
|
|
|
return fmt.Sprintf("Unknown identifier '%s'", err.Name)
|
|
}
|