func (ec *ErrorCode) UnmarshalText(text []byte) error {
	desc, ok := idToDescriptors[string(text)]
	if !ok {
		desc = ErrorCodeUnknown.Descriptor()
	}
	*ec = desc.Code
	return nil
}
UnmarshalText decodes the form generated by MarshalText.
package errcode
import (
	"encoding/json"
	"fmt"
	"strings"
)
type ErrorCoder interface {
	ErrorCode() ErrorCode
}
type ErrorCode int
var _ error = ErrorCode(0)
func (ec ErrorCode) ErrorCode() ErrorCode {
	return ec
}
func (ec ErrorCode) Error() string {
	return ec.Descriptor().Value
}
func (ec ErrorCode) Descriptor() ErrorDescriptor {
	d, ok := errorCodeToDescriptors[ec]
	if !ok {
		return ErrorCodeUnknown.Descriptor()
	}
	return d
}
func (ec ErrorCode) String() string {
	return ec.Descriptor().Value
}
func (ec ErrorCode) Message() string {
	return ec.Descriptor().Message
}
func (ec ErrorCode) MarshalText() (text []byte, err error) {
	return []byte(ec.String()), nil
}