24 lines
617 B
Go
24 lines
617 B
Go
// Package ident is the reference implementation of system and member
|
|
// identifiers.
|
|
package ident
|
|
|
|
import (
|
|
"errors"
|
|
"strconv"
|
|
)
|
|
|
|
// ErrNewline is returned for identifiers found to contain newline characters.
|
|
var ErrNewline = errors.New("identifier contains newline characters")
|
|
|
|
// UnexpectedSizeError describes a malformed string representation of an
|
|
// identifier, with unexpected length.
|
|
type UnexpectedSizeError struct {
|
|
Data []byte
|
|
Want int
|
|
}
|
|
|
|
func (e *UnexpectedSizeError) Error() string {
|
|
return "got " + strconv.Itoa(len(e.Data)) + " bytes for " +
|
|
"a " + strconv.Itoa(e.Want) + "-byte identifier"
|
|
}
|