Browse Source

s/brace/bracket

...oops. "[]" are brackets. "{}" are braces.
Carl Jackson 12 years ago
parent
commit
74e5c940d0
2 changed files with 8 additions and 8 deletions
  1. +6
    -6
      param/errors.go
  2. +2
    -2
      param/parse.go

+ 6
- 6
param/errors.go View File

@ -63,8 +63,8 @@ func (n NestingError) Error() string {
type SyntaxErrorSubtype int
const (
MissingOpeningBrace SyntaxErrorSubtype = iota + 1
MissingClosingBrace
MissingOpeningBracket SyntaxErrorSubtype = iota + 1
MissingClosingBracket
)
// SyntaxError is an error type returned when a key is incorrectly formatted.
@ -83,11 +83,11 @@ func (s SyntaxError) Error() string {
s.Key)
switch s.Subtype {
case MissingOpeningBrace:
return prefix + fmt.Sprintf("expected opening brace, got %q",
case MissingOpeningBracket:
return prefix + fmt.Sprintf("expected opening bracket, got %q",
s.ErrorPart)
case MissingClosingBrace:
return prefix + fmt.Sprintf("expected closing brace in %q",
case MissingClosingBracket:
return prefix + fmt.Sprintf("expected closing bracket in %q",
s.ErrorPart)
default:
panic("switch is not exhaustive!")


+ 2
- 2
param/parse.go View File

@ -80,7 +80,7 @@ func keyed(tipe reflect.Type, key, keytail string) (string, string) {
if keytail[0] != '[' {
panic(SyntaxError{
Key: kpath(key, keytail),
Subtype: MissingOpeningBrace,
Subtype: MissingOpeningBracket,
ErrorPart: keytail,
})
}
@ -89,7 +89,7 @@ func keyed(tipe reflect.Type, key, keytail string) (string, string) {
if idx == -1 {
panic(SyntaxError{
Key: kpath(key, keytail),
Subtype: MissingClosingBrace,
Subtype: MissingClosingBracket,
ErrorPart: keytail[1:],
})
}


Loading…
Cancel
Save