Refactored code structure
This commit is contained in:
18
src/build/errors/UnknownIdentifier.go
Normal file
18
src/build/errors/UnknownIdentifier.go
Normal file
@ -0,0 +1,18 @@
|
||||
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)
|
||||
}
|
Reference in New Issue
Block a user