-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.go
More file actions
30 lines (25 loc) · 779 Bytes
/
Copy patherrors.go
File metadata and controls
30 lines (25 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package makefile
import (
"fmt"
)
//ErrIllegalRune is an error type returned indicating that a rune is not allowed
type ErrIllegalRune struct {
Rune rune //the illegal rune
SrcString string //the string it was found in
SrcType string //the type of the source string (MakeVar, etc.)
Context string //the subtype of error (e.g. "initial")
}
func (err ErrIllegalRune) Error() string {
cont := err.Context
if cont != "" {
cont = fmt.Sprintf(" %s", cont)
}
return fmt.Sprintf("makefile: illegal%s rune %q in %q (a %s)", cont, err.Rune, err.SrcString, err.SrcType)
}
//ErrEmpty is an error returned when something is empty
type ErrEmpty struct {
SrcType string
}
func (err ErrEmpty) Error() string {
return fmt.Sprintf("makefile: empty %s", err.SrcType)
}